diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 02:20:08 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 02:20:08 +0000 |
commit | 124050cb2658fb18d47989ccc4614b88b869489e (patch) | |
tree | 21ecb02765985c4d7dbe973824cdc242b80864cf /content/common | |
parent | 2357868189633f0e115648d744522b6063d2c440 (diff) | |
download | chromium_src-124050cb2658fb18d47989ccc4614b88b869489e.zip chromium_src-124050cb2658fb18d47989ccc4614b88b869489e.tar.gz chromium_src-124050cb2658fb18d47989ccc4614b88b869489e.tar.bz2 |
Fix a crash in the GPU process which occurs while handling a message. For the curious the crash
happens because we fail to look up the GpuCommandBufferStub instance for the message and end up
dereferencing the same.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/9006002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/gpu/gpu_channel.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 7622e30..177a5e4 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -264,16 +264,19 @@ void GpuChannel::HandleMessage() { // or has more work to do, synthesize an IPC message to flush the command // buffer that became unscheduled. GpuCommandBufferStub* stub = stubs_.Lookup(message->routing_id()); - if (!stub->IsScheduled() || stub->HasMoreWork()) { - deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled( - stub->route_id())); - } - if (stub->HasMoreWork() && !handle_messages_scheduled_) { - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&GpuChannel::HandleMessage, weak_factory_.GetWeakPtr()), - kHandleMoreWorkPeriod); - handle_messages_scheduled_ = true; + if (stub) { + if (!stub->IsScheduled() || stub->HasMoreWork()) { + deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled( + stub->route_id())); + } + if (stub->HasMoreWork() && !handle_messages_scheduled_) { + MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::Bind(&GpuChannel::HandleMessage, + weak_factory_.GetWeakPtr()), + kHandleMoreWorkPeriod); + handle_messages_scheduled_ = true; + } } } } |