diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:13:23 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:13:23 +0000 |
commit | f9a2b2fe071c001a6864e527fd7035489a985243 (patch) | |
tree | 292270a6c99f2ac4ab9658ca3899307b28f66c91 /chrome/renderer/render_thread.cc | |
parent | 52a838a34ea1b0febd12a966ebb008f0f88c1a81 (diff) | |
download | chromium_src-f9a2b2fe071c001a6864e527fd7035489a985243.zip chromium_src-f9a2b2fe071c001a6864e527fd7035489a985243.tar.gz chromium_src-f9a2b2fe071c001a6864e527fd7035489a985243.tar.bz2 |
Fix a race where WebGL would attempt to use the GpuChannel before it was in the CONNECTED state.
I modified things so that GpuChannelHost goes into the CONNECTED state as soon as the SyncChannel is created. This is safe because any IPC messages that are send are just queued up in the named pipe.
TEST=try
BUG=none
Review URL: http://codereview.chromium.org/2959016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_thread.cc')
-rw-r--r-- | chrome/renderer/render_thread.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 95588c8..3573488 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -741,19 +741,9 @@ void RenderThread::EstablishGpuChannel() { } GpuChannelHost* RenderThread::EstablishGpuChannelSync() { - // 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(); + EstablishGpuChannel(); + Send(new ViewHostMsg_SynchronizeGpu()); + return GetGpuChannel(); } GpuChannelHost* RenderThread::GetGpuChannel() { |