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

Issue 213413005: Ensure RenderViewHost is not shut down until a screenshot of the page is taken.

Created:
6 years, 9 months ago by mfomitchev
Modified:
6 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Ensure RenderViewHost is not shut down until a screenshot of the page is taken. Continuation of the work started in issue 178843004. See https://chromiumcodereview.appspot.com/178843004/ =============================================== Pasted description from 178843004: [wip] Add some more state to RenderViewHost's lifetime. Keep track of in-flight copy-requests for a RenderViewHost. If a RenderViewHost has pending copy-requests, then: * Do not decrement active-view-count on the SiteInstance when the RenderViewHost becomes inactive. * Hold back sending was-swapped-out IPC to the renderer. * Do not run the shutdown-on-swap callback. When all the copy-requests are completed in the RenderViewHost: * Check if the current state of the RenderViewHost is not active anymore. If it's not active, then send the was-swapped-out message. This should work because new copy-requests are not made if the RenderViewHost isn't in an active state. * If the current state is not active, then also decrement the active-view count on the SiteInstance. * If the state is in a pending-shutdown state, then run the callback. BUG==340682

Patch Set 1 #

Patch Set 2 : Fixing some unit tests. #

Total comments: 32

Patch Set 3 : Implementing review feedback. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -16 lines) Patch
M chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc View 1 2 3 chunks +29 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_entry_screenshot_manager.cc View 1 2 3 chunks +7 lines, -7 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 2 2 chunks +8 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 chunks +23 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 5 chunks +72 lines, -4 lines 2 comments Download

Messages

Total messages: 9 (0 generated)
mfomitchev
creis@, clamy@ - this is the continuation of the work on the fix for cross-site ...
6 years, 9 months ago (2014-03-26 18:59:30 UTC) #1
Charlie Reis
Nasko: Can you take a first look at this for me, since you've also been ...
6 years, 9 months ago (2014-03-26 19:26:01 UTC) #2
nasko
I think the CL needs a few changes, but overall it is a good start. ...
6 years, 9 months ago (2014-03-26 22:48:27 UTC) #3
clamy
Thanks! There are some corner cases that need to be addressed, and may require some ...
6 years, 9 months ago (2014-03-27 15:59:36 UTC) #4
mfomitchev
I made a significant change in WasSwappedOut() logic: RVH now moves from STATE_WAITING_FOR_COMMIT to STATE_PENDING_SHUTDOWN ...
6 years, 9 months ago (2014-03-27 21:51:33 UTC) #5
mfomitchev
Looks like I picked up some changes from other CLs here when I rebased. Sorry ...
6 years, 9 months ago (2014-03-27 22:06:28 UTC) #6
clamy
Thanks! It does look better, but I am afraid that adding more booleans to RenderViewHostImpl ...
6 years, 9 months ago (2014-03-28 11:03:39 UTC) #7
Charlie Reis
I haven't had the time to dive into this as deeply as I'd like due ...
6 years, 9 months ago (2014-03-28 17:12:29 UTC) #8
mfomitchev
6 years, 9 months ago (2014-03-28 17:50:12 UTC) #9
Thanks for the prompt feedback. 

1) I can certainly produce a design doc or edit the existing one
(https://docs.google.com/a/google.com/document/d/1CW3NZH8ZR6tCA7ick4d3O4exAjIw...).
That said, it sounds like we need to agree on whether the best approach is
adding new states or modifying the active view count. Can we have that
discussion without the design doc or we need the design doc first?

2) Assuming we want this to work with the new design, perhaps it would help to
get this straightened up before you guys make the jump? Otherwise aren't we
risking missing something important in the new design?

3) IIRC the issue is that the textures in the browser process will only contain
what's visible. If the browser window is partially off screen for example when
the screenshot is taken, the off screen portion won't be captured. If the
browser window is later shifted, this would present a problem. sadrul@ can
correct me if I am inaccurate on this one.

There's clearly no hope of getting this in for M35, so I will hold off with
further submissions in this review until we can figure some of these things out.

Powered by Google App Engine
This is Rietveld 408576698