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

Issue 6246007: Generate thumbnails in the browser process. (Closed)

Created:
9 years, 11 months ago by satorux1
Modified:
9 years, 7 months ago
Reviewers:
brettw, Daniel Erat
CC:
chromium-reviews, darin-cc_chromium.org, brettw-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Generate thumbnails in the browser process. The feature is now behind --enable-in-browser-thumbnailing flag. The in-browser thumbnailing works as follows: - The scroll offset is sent from the renderer to the browser. - The thumbnail is taken when the page info is sent from the renderer process. - Since thumbnails are generated in the browser, we can avoid the generation when unnecessary (ex. off-the-record mode, or New Tab Page). - The quality of thumbnails is as good as before, as the patch doesn't change timing heuristics. - The drawback is that we cannot take thumbnails from background tabs. New functions are added to ThumbnailGenerator for clipping thumbnails, with tests. BUG=65936 TEST=add unit tests for thumbnail_generator. confirmed that the thumbnails are updated with and without --enable-in-browser-thumbnailing Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72115

Patch Set 1 #

Total comments: 4

Patch Set 2 : more polishing #

Patch Set 3 : minor cleanup #

Total comments: 2

Patch Set 4 : Move scroll offset into ViewHostMsg_UpdateRect_Params #

Total comments: 5

Patch Set 5 : address comments #

Patch Set 6 : fix the debug build #

Patch Set 7 : fix the function name... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -22 lines) Patch
M chrome/browser/renderer_host/browser_render_process_host.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/thumbnail_generator.h View 1 2 3 4 4 chunks +49 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/thumbnail_generator.cc View 1 2 3 4 5 6 8 chunks +149 lines, -20 lines 0 comments Download
M chrome/browser/tab_contents/thumbnail_generator_unittest.cc View 1 2 2 chunks +100 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/render_messages_params.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/render_messages_params.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 2 chunks +12 lines, -1 line 0 comments Download
M chrome/renderer/render_widget.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/renderer/render_widget.cc View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
brettw
http://codereview.chromium.org/6246007/diff/1/chrome/renderer/render_view.cc File chrome/renderer/render_view.cc (left): http://codereview.chromium.org/6246007/diff/1/chrome/renderer/render_view.cc#oldcode1281 chrome/renderer/render_view.cc:1281: bool RenderView::CaptureThumbnail(WebView* view, I think we probably want to ...
9 years, 11 months ago (2011-01-18 18:25:37 UTC) #1
satorux1
Thank you for the great feedback! http://codereview.chromium.org/6246007/diff/1/chrome/renderer/render_view.cc File chrome/renderer/render_view.cc (left): http://codereview.chromium.org/6246007/diff/1/chrome/renderer/render_view.cc#oldcode1281 chrome/renderer/render_view.cc:1281: bool RenderView::CaptureThumbnail(WebView* view, ...
9 years, 11 months ago (2011-01-19 01:36:32 UTC) #2
satorux1
Brett, Just added --enable-in-browser-thumbnailing per your suggestion. I think the patch is now ready for ...
9 years, 11 months ago (2011-01-19 08:47:14 UTC) #3
brettw
Let me summarize what I was originally thinking for this feature. One of the problems ...
9 years, 11 months ago (2011-01-20 00:30:51 UTC) #4
satorux1
Brett, Thank you for sharing your thoughts. I agree with you that it would be ...
9 years, 11 months ago (2011-01-20 03:06:29 UTC) #5
satorux1
+derat for his thought on the overview mode. Per your feedback, moved the scroll offset ...
9 years, 11 months ago (2011-01-20 05:43:39 UTC) #6
Daniel Erat
Removing the existing overview implementation (both from Chrome and from the window manager) would greatly ...
9 years, 11 months ago (2011-01-20 18:25:13 UTC) #7
brettw
LGTM I have a few comments that are mostly trivial. If you agree with these ...
9 years, 11 months ago (2011-01-21 00:09:17 UTC) #8
satorux1
9 years, 11 months ago (2011-01-21 04:53:43 UTC) #9
http://codereview.chromium.org/6246007/diff/13001/chrome/browser/tab_contents...
File chrome/browser/tab_contents/tab_contents.cc (right):

http://codereview.chromium.org/6246007/diff/13001/chrome/browser/tab_contents...
chrome/browser/tab_contents/tab_contents.cc:2237: void
TabContents::UpdateThumbnailIfNecessary(const GURL& url) {
On 2011/01/21 00:09:17, brettw wrote:
> I'm always trying to get people to not add stuff to TabContents since it's
> already so large. How about moving this function to the ThumbnailGenerator and
> have the TabContents call it (possibly providing "this" as an argument). Then
> the code is more in the right place when we refactor this later.
> 
> This will also allow you to remove the thumbnail_score.h include.

That's a good idea. Moved accordingly.

http://codereview.chromium.org/6246007/diff/13001/chrome/browser/tab_contents...
File chrome/browser/tab_contents/thumbnail_generator.h (right):

http://codereview.chromium.org/6246007/diff/13001/chrome/browser/tab_contents...
chrome/browser/tab_contents/thumbnail_generator.h:45: kNone = 0,
On 2011/01/21 00:09:17, brettw wrote:
> Can you rename this to kNoOptions (or something similar) so it's more unique?

Done.

Powered by Google App Engine
This is Rietveld 408576698