Right now we only initialize it in GPU thread in GpuInit::InitializeInProcess(). In WebView, we need to make sure other threads using GL wait until this happens (wait until compositor thread returns a valid frame).
This is not optimal.
So after discussion with boliu, piman, kbr, here is the proposal:
Initialize GL in either render thread (DeferredGpuCommandService) or GPU thread, whoever gets to it first. The initialization code needs to be guarded by a lock to avoid racing.
Also, DeferredGpuCommandService side, we don't need to pre-initialize it in SetService(). It can be done on demand in GetService().
After this, we can get rid of the current blocking mechanism.
Comment 1 by zmo@chromium.org
, Feb 1 2018