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/gpu_channel_host.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/gpu_channel_host.cc')
-rw-r--r-- | chrome/renderer/gpu_channel_host.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc index 3562c0b..1f2eb21 100644 --- a/chrome/renderer/gpu_channel_host.cc +++ b/chrome/renderer/gpu_channel_host.cc @@ -20,6 +20,11 @@ void GpuChannelHost::Connect(const std::string& channel_name) { channel_name, IPC::Channel::MODE_CLIENT, this, NULL, ChildProcess::current()->io_message_loop(), true, ChildProcess::current()->GetShutDownEvent())); + + // It is safe to send IPC messages before the channel completes the connection + // and receives the hello message from the GPU process. The messages get + // cached. + state_ = CONNECTED; } void GpuChannelHost::OnMessageReceived(const IPC::Message& message) { @@ -30,7 +35,6 @@ void GpuChannelHost::OnMessageReceived(const IPC::Message& message) { } void GpuChannelHost::OnChannelConnected(int32 peer_pid) { - state_ = CONNECTED; } void GpuChannelHost::OnChannelError() { |