diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 00:31:22 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 00:31:22 +0000 |
commit | 1082b1dd85c92e5260911989d8022988bacb676e (patch) | |
tree | db12d29cafe47d38e3e9657dea037daf694348d7 /chrome/renderer/render_thread.cc | |
parent | 66ee443252fd759c5e20cb93be1e90a732da0ebe (diff) | |
download | chromium_src-1082b1dd85c92e5260911989d8022988bacb676e.zip chromium_src-1082b1dd85c92e5260911989d8022988bacb676e.tar.gz chromium_src-1082b1dd85c92e5260911989d8022988bacb676e.tar.bz2 |
Split GpuProcessHost into GpuProcessHostUIShim, which runs on the UI
thread, and GpuProcessHost, which now runs on the IO thread and
derives from ChildProcessHost. This split was necessary in order to
service synchronous messages from the renderer process. Moved message
handlers for GPU messages from renderer to browser from
BrowserRenderProcessHost to ResourceMessageFilter.
Stopped sending multiple ViewHostMsg_EstablishGpuChannel messages from
the same renderer if the connection was already established. Resetting
the channel was causing failures in Send, and every other page reload
containing WebGL content to fail. This cleanup will allow further
simplification in the GPU process, but this is being left for a
subsequent CL.
Fixed bug in sandboxing of GPU process. Fixed latent bugs in cleanup
code in GpuChannel and GpuChannelHost. Fixed crashes in
ChildProcessHost if resource_dispatcher_host_ was NULL. Fixed apparent
latent race conditions in creation of BackingStoreProxy and
VideoLayerProxy.
With these changes, WebGL content is running in the sandbox on both
Mac and Windows. Linux support will be added in a following CL.
BUG=29120
TEST=ran WebGL demos on Mac and Windows
Review URL: http://codereview.chromium.org/1546001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43029 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_thread.cc')
-rw-r--r-- | chrome/renderer/render_thread.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index aff8fa6..81636c7 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -687,8 +687,10 @@ void RenderThread::UpdateActiveExtensions() { void RenderThread::EstablishGpuChannel() { if (gpu_channel_.get()) { - // Do nothing if we are already establishing GPU channel. - if (gpu_channel_->state() == GpuChannelHost::UNCONNECTED) + // Do nothing if we already have a GPU channel or are already + // establishing one. + if (gpu_channel_->state() == GpuChannelHost::UNCONNECTED || + gpu_channel_->state() == GpuChannelHost::CONNECTED) return; // Recreate the channel if it has been lost. @@ -704,8 +706,16 @@ void RenderThread::EstablishGpuChannel() { } GpuChannelHost* RenderThread::EstablishGpuChannelSync() { - EstablishGpuChannel(); - Send(new ViewHostMsg_SynchronizeGpu()); + // We may need to retry the connection establishment if an existing + // connection has gone bad, which will not be detected in + // EstablishGpuChannel since we do not send duplicate + // ViewHostMsg_EstablishGpuChannel messages -- doing so breaks the + // preexisting connection in bad ways. + bool retry = true; + for (int i = 0; i < 2 && retry; ++i) { + EstablishGpuChannel(); + retry = !Send(new ViewHostMsg_SynchronizeGpu()); + } // TODO(kbr): the GPU channel is still in the unconnected state at this point. // Need to figure out whether it is really safe to return it. return gpu_channel_.get(); |