diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 01:40:33 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 01:40:33 +0000 |
commit | 83cb753f7aa8453fb144fc2b512e09026e1daa36 (patch) | |
tree | 7b79dc609255f8128306b51d5ab2ce0d75d9b01d /content/common/gpu/image_transport_surface.h | |
parent | b28603d6e6a193d52aeee1df37de614248d7251b (diff) | |
download | chromium_src-83cb753f7aa8453fb144fc2b512e09026e1daa36.zip chromium_src-83cb753f7aa8453fb144fc2b512e09026e1daa36.tar.gz chromium_src-83cb753f7aa8453fb144fc2b512e09026e1daa36.tar.bz2 |
Delay GpuCommandBufferStub::AddDestructionObserver until we need it.
In certain failure cases at initialization time (caused by a race) we used to call
AddDestructionObserver before we would make the surface current, causing us to
destroy the surface before OnWillDestroyStub had a chance to be called, so we
wouldn't RemoveDestructionObserver and we'd call into a dead pointer.
This fixes it. By the time MakeCurrent is called, we know we have a ref to the
surface and it won't destroy it until GpuCommandBufferStub::Destroy, after
OnWillDestroyStub is called.
BUG=140502
TEST=attach debugger to renderer, add a breakpoint to CommandBufferProxyImpl::Initialize, right-click and "view page source" (breakpoint should hit), kill new tab, and only then continue breakpoint. Observe no GPU process crash.
Review URL: https://chromiumcodereview.appspot.com/10831169
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/image_transport_surface.h')
-rw-r--r-- | content/common/gpu/image_transport_surface.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h index 4cbad57..348b5f6 100644 --- a/content/common/gpu/image_transport_surface.h +++ b/content/common/gpu/image_transport_surface.h @@ -131,6 +131,7 @@ class ImageTransportHelper : public IPC::Listener { void Suspend(); GpuChannelManager* manager() const { return manager_; } + GpuCommandBufferStub* stub() const { return stub_.get(); } private: gpu::GpuScheduler* Scheduler(); |