Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Issue 6076005: Mac: Don't hang gpu process on popup close under certain conditions (Closed)

Created:
10 years ago by Nico
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, darin-cc_chromium.org, apatrick_chromium, brettw-cc_chromium.org
Visibility:
Public.

Description

Mac: Don't hang gpu process if a tab is closed 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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70000

Patch Set 1 #

Patch Set 2 : slightly better #

Patch Set 3 : '' #

Patch Set 4 : renderer route id instead of gpu id. does not help though? #

Patch Set 5 : works #

Patch Set 6 : final touches #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -15 lines) Patch
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/common/gpu_messages_internal.h View 1 2 3 1 chunk +7 lines, -0 lines 1 comment Download
M chrome/gpu/gpu_channel.h View 1 2 3 4 3 chunks +9 lines, -1 line 0 comments Download
M chrome/gpu/gpu_channel.cc View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/gpu/gpu_command_buffer_stub.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/gpu/gpu_command_buffer_stub.cc View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/gpu/gpu_thread.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/gpu/gpu_thread.cc View 1 2 3 4 2 chunks +14 lines, -12 lines 0 comments Download
M gpu/command_buffer/service/gpu_processor.h View 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gpu_processor_mac.cc View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Nico
10 years ago (2010-12-22 22:54:03 UTC) #1
Ken Russell (switch to Gerrit)
LGTM. Very nice. Thanks for cleaning this up. One small naming comment, up to you. ...
10 years ago (2010-12-22 23:16:43 UTC) #2
Nico
10 years ago (2010-12-22 23:28:46 UTC) #3
Thanks, submitting.

On Wed, Dec 22, 2010 at 3:16 PM,  <kbr@chromium.org> wrote:
> LGTM. Very nice. Thanks for cleaning this up. One small naming comment, up
> to
> you.
>
>
>
>
http://codereview.chromium.org/6076005/diff/12001/chrome/common/gpu_messages_...
> File chrome/common/gpu_messages_internal.h (right):
>
>
http://codereview.chromium.org/6076005/diff/12001/chrome/common/gpu_messages_...
> chrome/common/gpu_messages_internal.h:66:
> IPC_MESSAGE_CONTROL2(GpuMsg_DidDestroySurface,
> You might want to call this DidDestroyAcceleratedSurface to match the
> other similar message names; this is not a big deal however.

Done.

>
> http://codereview.chromium.org/6076005/
>

Powered by Google App Engine
This is Rietveld 408576698