diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 23:33:58 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 23:33:58 +0000 |
commit | b2e52d1a5a76e19512cd90402a09e0ae108b4c6e (patch) | |
tree | 32e080da6511a891b6e179af8f435c4266501c0b /chrome/gpu/gpu_channel.h | |
parent | d5bc2ed4baad44064d6158bc952e239001e95be1 (diff) | |
download | chromium_src-b2e52d1a5a76e19512cd90402a09e0ae108b4c6e.zip chromium_src-b2e52d1a5a76e19512cd90402a09e0ae108b4c6e.tar.gz chromium_src-b2e52d1a5a76e19512cd90402a09e0ae108b4c6e.tar.bz2 |
Mac: Don't hang gpu process if a tab that shares its renderer process with other tabs and that has accelerated content and outstanding paints.
The problem was that the renderer process busy-waits on the GPU process to flush all gpu commands on close, and the GPU process waits with processing commands from the renderer until a paint ack arrives from the browser. But since the window is already closed, no paint acks are sent any more.
The fix is to let the browser tell the GPU process when a window is closed, and then let the GPU process not wait for paint acks if the corresponding window has already been closed.
Closed windows are identified by (renderer process id, render view routing id). Identifying closed windows by either surface id or gpu channel stub routing id does not work, because they are both created on the GPU side and sent to the browser asynchronously, so it's possible that a browser tab is closed before the ID arrives from the GPU process – in that case, it can't send the "window closed" message even though the GPU process is already in a state where it needs this event.
BUG=67170
TEST=
1.) Go to http://www.chromeexperiments.com/detail/body-browser/?f=webgl , click "Launch Experiment", wait until everything is loaded, close popup. %cpu of gpu process and renderer process should go to 0
2.) Go to http://www.chromeexperiments.com/detail/body-browser/?f=webgl , click "Launch Experiment", wait until the bar on the left is loaded but the body isn't yet, close popup. %cpu of gpu process and renderer process should go to 0, but it might take a few seconds until the %cpu in the renderer go down (the site decides to parse the XHR data that gets flushed on widget close)
3.) Go to http://www.chromeexperiments.com/detail/nine-point-five/?f=webgl , click "Launch Experiment", wait until everything is loaded, close popup. %cpu of gpu process and renderer process should go to 0
4.) Go to http://www.chromeexperiments.com/detail/nine-point-five/?f=webgl , click "Launch Experiment", close popup immediately after the background color changed to light grey. %cpu of gpu process and renderer process should go to 0
5.) Go to http://www.chromeexperiments.com/detail/nine-point-five/?f=webgl , click "Launch Experiment", close popup immediately. %cpu of gpu process and renderer process should go to 0
Review URL: http://codereview.chromium.org/6076005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_channel.h')
-rw-r--r-- | chrome/gpu/gpu_channel.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/gpu/gpu_channel.h b/chrome/gpu/gpu_channel.h index 53c0d70..e449dc4 100644 --- a/chrome/gpu/gpu_channel.h +++ b/chrome/gpu/gpu_channel.h @@ -6,6 +6,7 @@ #define CHROME_GPU_GPU_CHANNEL_H_ #pragma once +#include <set> #include <string> #include <vector> @@ -55,6 +56,9 @@ class GpuChannel : public IPC::Channel::Listener, #if defined(OS_MACOSX) virtual void AcceleratedSurfaceBuffersSwapped( int32 route_id, uint64 swap_buffers_count); + void DidDestroySurface(int32 renderer_route_id); + + bool IsRenderViewGone(int32 renderer_route_id); #endif private: @@ -94,7 +98,11 @@ class GpuChannel : public IPC::Channel::Listener, #if defined(ENABLE_GPU) typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; StubMap stubs_; -#endif + +#if defined(OS_MACOSX) + std::set<int32> destroyed_renderer_routes_; +#endif // defined (OS_MACOSX) +#endif // defined (ENABLE_GPU) bool log_messages_; // True if we should log sent and received messages. |