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

Issue 1348833003: Fix NTP thumbnail generation (Closed)

Created:
5 years, 3 months ago by shrike
Modified:
5 years, 1 month ago
Reviewers:
Lei Zhang, motek., ccameron
CC:
chromium-reviews, yusukes+watch_chromium.org, Ian Vollick, shuchen+watch_chromium.org, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, James Su, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix NTP thumbnail generation This change delays browser compositor view suspention until pending thumbnail generation has completed. This solution uses polling to check if it's OK to suspend the compositor, which is not great. Also, there's a potential race condition between the user foregrounding the tab and the pending suspension. Ideally the thumnail generation operation would signal the compositor that it's OK to proceed with its suspension, and the compositor would only suspend itself if it has not been reactivated. I'm just not sure of the best way to approach that. BUG=530707 Committed: https://crrev.com/d77a3639f04f83a5c5cf47d88dbac2f0d4345ea5 Cr-Commit-Position: refs/heads/master@{#359361}

Patch Set 1 #

Patch Set 2 : Fix NTP thumbnail generation using IncrementCapturerCount #

Total comments: 4

Patch Set 3 : Fix bug and clean up code. #

Total comments: 4

Patch Set 4 : Code cleanup. #

Patch Set 5 : Watch for destruction of web_contents. #

Total comments: 2

Patch Set 6 : Refactor ThumbnailingContext from struct to class. #

Total comments: 10

Patch Set 7 : Fix nits. #

Total comments: 2

Patch Set 8 : Fix more nits. #

Patch Set 9 : Fix compilation error. #

Patch Set 10 : Fix unit test output. #

Patch Set 11 : Ensure browser_compositor_ exists before destroying it. #

Patch Set 12 : Add ccameron's patch. #

Total comments: 2

Patch Set 13 : Fix nit. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -72 lines) Patch
M chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +39 lines, -24 lines 0 comments Download
M chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc View 1 2 3 4 5 5 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/thumbnails/simple_thumbnail_crop.cc View 1 2 3 4 5 1 chunk +10 lines, -7 lines 0 comments Download
M chrome/browser/thumbnails/thumbnail_service.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/thumbnails/thumbnail_service_impl.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/thumbnails/thumbnail_tab_helper.cc View 1 2 3 4 5 4 chunks +20 lines, -10 lines 0 comments Download
M chrome/browser/thumbnails/thumbnailing_context.h View 1 2 3 4 5 6 7 8 3 chunks +24 lines, -7 lines 0 comments Download
M chrome/browser/thumbnails/thumbnailing_context.cc View 1 2 3 4 5 6 7 8 9 1 chunk +44 lines, -6 lines 0 comments Download
A chrome/browser/thumbnails/thumbnailing_context_unittest.cc View 1 2 3 4 5 6 7 1 chunk +70 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/compositor/delegated_frame_host.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +6 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 56 (13 generated)
shrike
Hello ccameron, This cl takes a stab at fixing the thumbnail generation problem by delaying ...
5 years, 3 months ago (2015-09-16 22:38:41 UTC) #2
ccameron
I just realized that we already have 2 mechanisms that can solve this. 1. We ...
5 years, 3 months ago (2015-09-16 22:57:30 UTC) #3
shrike
On 2015/09/16 22:57:30, ccameron wrote: > I just realized that we already have 2 mechanisms ...
5 years, 3 months ago (2015-09-17 00:32:02 UTC) #5
danakj
https://codereview.chromium.org/1348833003/diff/40001/chrome/browser/thumbnails/thumbnail_tab_helper.cc File chrome/browser/thumbnails/thumbnail_tab_helper.cc (right): https://codereview.chromium.org/1348833003/diff/40001/chrome/browser/thumbnails/thumbnail_tab_helper.cc#newcode78 chrome/browser/thumbnails/thumbnail_tab_helper.cc:78: context->web_contents->DecrementCapturerCount(); Do you not want to do this if ...
5 years, 3 months ago (2015-09-17 17:54:14 UTC) #6
shrike
I'm working on a browser test to make sure this fix does not get undone ...
5 years, 2 months ago (2015-09-28 21:24:11 UTC) #7
shrike
Hello ccameron, I have been working on a test for this change in order to ...
5 years, 2 months ago (2015-10-06 21:30:13 UTC) #8
ccameron
On 2015/10/06 21:30:13, shrike wrote: > Hello ccameron, > > I have been working on ...
5 years, 2 months ago (2015-10-06 21:36:05 UTC) #9
shrike
On 2015/10/06 21:36:05, ccameron wrote: > On 2015/10/06 21:30:13, shrike wrote: > > Hello ccameron, ...
5 years, 2 months ago (2015-10-06 21:50:30 UTC) #10
shrike
PTAL
5 years, 2 months ago (2015-10-06 23:18:16 UTC) #11
ccameron
lgtm!
5 years, 2 months ago (2015-10-07 00:49:10 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1348833003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1348833003/60001
5 years, 2 months ago (2015-10-07 16:24:57 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/107480)
5 years, 2 months ago (2015-10-07 16:39:33 UTC) #16
shrike
thestig for changes in chrome/browser/thumbnails (seems for these files I have to fall all the ...
5 years, 2 months ago (2015-10-07 16:55:43 UTC) #18
Lei Zhang
5 years, 2 months ago (2015-10-07 17:48:47 UTC) #20
Lei Zhang
https://codereview.chromium.org/1348833003/diff/60001/chrome/browser/thumbnails/thumbnail_tab_helper.cc File chrome/browser/thumbnails/thumbnail_tab_helper.cc (right): https://codereview.chromium.org/1348833003/diff/60001/chrome/browser/thumbnails/thumbnail_tab_helper.cc#newcode209 chrome/browser/thumbnails/thumbnail_tab_helper.cc:209: AsyncProcessThumbnail(web_contents, context, algorithm); Assuming having |web_contents| in |context| is ...
5 years, 2 months ago (2015-10-07 17:55:20 UTC) #21
shrike
thestig - changes made, PTAL, but I know we still need to get the OK ...
5 years, 2 months ago (2015-10-07 18:06:35 UTC) #22
motek.
On 2015/10/07 18:06:35, shrike wrote: > thestig - changes made, PTAL, but I know we ...
5 years, 2 months ago (2015-10-07 20:59:04 UTC) #23
Lei Zhang
On 2015/10/07 20:59:04, motek. wrote: > That has been a while, hard to recall details. ...
5 years, 2 months ago (2015-10-07 21:28:45 UTC) #24
ccameron
On 2015/10/07 21:28:45, Lei Zhang wrote: > On 2015/10/07 20:59:04, motek. wrote: > > That ...
5 years, 2 months ago (2015-10-07 22:06:25 UTC) #25
shrike
I have changed the thumbnailing context to derive from WebContentsObserver, so that its web_contents reference ...
5 years, 1 month ago (2015-10-26 23:20:46 UTC) #26
Lei Zhang
SGTM, can we make ThumbnailingContext a class with accessors? I hope there's not too many ...
5 years, 1 month ago (2015-10-26 23:31:35 UTC) #27
shrike
Hello thestig@, PTAL
5 years, 1 month ago (2015-11-02 21:48:27 UTC) #28
Lei Zhang
https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnail_tab_helper.cc File chrome/browser/thumbnails/thumbnail_tab_helper.cc (right): https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnail_tab_helper.cc#newcode75 chrome/browser/thumbnails/thumbnail_tab_helper.cc:75: context->web_contents()->DecrementCapturerCount(); FYI, this is fine, but ideally we'd have ...
5 years, 1 month ago (2015-11-02 22:41:31 UTC) #29
shrike
thestig@ - PTAL https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnail_tab_helper.cc File chrome/browser/thumbnails/thumbnail_tab_helper.cc (right): https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnail_tab_helper.cc#newcode75 chrome/browser/thumbnails/thumbnail_tab_helper.cc:75: context->web_contents()->DecrementCapturerCount(); On 2015/11/02 22:41:30, Lei Zhang ...
5 years, 1 month ago (2015-11-03 18:36:23 UTC) #30
Lei Zhang
lgtm with another round of nits. https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnailing_context_unittest.cc File chrome/browser/thumbnails/thumbnailing_context_unittest.cc (right): https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnailing_context_unittest.cc#newcode49 chrome/browser/thumbnails/thumbnailing_context_unittest.cc:49: EXPECT_TRUE(context->score().boring_score == boring_score); ...
5 years, 1 month ago (2015-11-03 18:59:25 UTC) #31
shrike
Hello thestig@ - PTAL https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnailing_context_unittest.cc File chrome/browser/thumbnails/thumbnailing_context_unittest.cc (right): https://codereview.chromium.org/1348833003/diff/120001/chrome/browser/thumbnails/thumbnailing_context_unittest.cc#newcode49 chrome/browser/thumbnails/thumbnailing_context_unittest.cc:49: EXPECT_TRUE(context->score().boring_score == boring_score); On 2015/11/03 ...
5 years, 1 month ago (2015-11-03 19:10:49 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1348833003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1348833003/160001
5 years, 1 month ago (2015-11-04 22:39:59 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/25679)
5 years, 1 month ago (2015-11-04 22:55:01 UTC) #37
shrike
ccameron - I have browser tests failing because DelegatedFrameHost::SwapDelegatedFrame() calls AddOnCommitCallbackAndDisableLocks() but |compositor_| is nullptr. ...
5 years, 1 month ago (2015-11-10 23:13:27 UTC) #38
ccameron
On 2015/11/10 23:13:27, shrike wrote: > ccameron - I have browser tests failing because > ...
5 years, 1 month ago (2015-11-10 23:47:07 UTC) #39
ccameron
On 2015/11/10 23:47:07, ccameron wrote: > On 2015/11/10 23:13:27, shrike wrote: > > ccameron - ...
5 years, 1 month ago (2015-11-11 00:04:39 UTC) #40
ccameron
On 2015/11/11 00:04:39, ccameron wrote: > On 2015/11/10 23:47:07, ccameron wrote: > > On 2015/11/10 ...
5 years, 1 month ago (2015-11-11 01:57:58 UTC) #41
ccameron
On 2015/11/11 01:57:58, ccameron wrote: > On 2015/11/11 00:04:39, ccameron wrote: > > On 2015/11/10 ...
5 years, 1 month ago (2015-11-11 02:00:18 UTC) #42
shrike
On 2015/11/11 02:00:18, ccameron wrote: > And... I lied. It should read > > - ...
5 years, 1 month ago (2015-11-11 21:58:36 UTC) #43
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1348833003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1348833003/240001
5 years, 1 month ago (2015-11-12 02:37:19 UTC) #45
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-11-12 03:21:54 UTC) #47
shrike
thestig - would you please take a quick look at thumbnailing_context.cc and content_based_thumbnailing_algorithm.cc? I made ...
5 years, 1 month ago (2015-11-12 05:27:30 UTC) #48
Lei Zhang
lgtm still https://codereview.chromium.org/1348833003/diff/240001/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc File chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc (right): https://codereview.chromium.org/1348833003/diff/240001/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc#newcode179 chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc:179: if (context->web_contents() != nullptr) { nit: no ...
5 years, 1 month ago (2015-11-12 07:13:17 UTC) #49
shrike
https://codereview.chromium.org/1348833003/diff/240001/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc File chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc (right): https://codereview.chromium.org/1348833003/diff/240001/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc#newcode179 chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc:179: if (context->web_contents() != nullptr) { On 2015/11/12 07:13:16, Lei ...
5 years, 1 month ago (2015-11-12 17:59:23 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1348833003/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1348833003/260001
5 years, 1 month ago (2015-11-12 18:00:18 UTC) #53
commit-bot: I haz the power
Committed patchset #13 (id:260001)
5 years, 1 month ago (2015-11-12 19:41:16 UTC) #54
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/d77a3639f04f83a5c5cf47d88dbac2f0d4345ea5 Cr-Commit-Position: refs/heads/master@{#359361}
5 years, 1 month ago (2015-11-12 20:09:10 UTC) #55
zhaoqin
5 years, 1 month ago (2015-11-13 15:55:32 UTC) #56
Message was sent while issue was closed.
A revert of this CL (patchset #13 id:260001) has been created in
https://codereview.chromium.org/1443723002/ by zhaoqin@google.com.

The reason for reverting is: possible culprit of an uninit error

BUG=555567
TBR=shrike@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698