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

Issue 2931023002: [TooManyTabs] Add TabNavigationThrottle (Closed)

Created:
3 years, 6 months ago by Zhen Wang
Modified:
3 years, 5 months ago
CC:
chromium-reviews, jam, chrome-grc-reviews_chromium.org, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org, lpy, shaseley
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[TooManyTabs] Add TabNavigationThrottle This is the 1st CL for staggered background tab opening feature. It adds TabNavigationThrottle, which plumbs navigation information into TabManager and enables TabManager to defer navigation for background tabs. This CL uses a simple algorithm, which defers background tab's navigation when some tab is loading. After a tab finishes loading, it will resume another pending navigation. TabManager will also resume a pending navigation when a background tab is selected. This feature is currently implemented behind a flag. This feature will not be enabled until the corresponding metrics are ready. This CL focuses on plumbing navigation into TabManager. The actual algorithm to delay background tab opening is simple. But it should be fine because the whole feature is behind a flag right now. There will be follow-up CLs to consider system resources and refine the algorithm. Design doc: https://docs.google.com/document/d/1_CS5kcY00CE3pzDTtW5Ny221gWfk4mFXYGiezoYSCBI/ BUG=730098 Review-Url: https://codereview.chromium.org/2931023002 Cr-Commit-Position: refs/heads/master@{#485870} Committed: https://chromium.googlesource.com/chromium/src/+/6edd49c516047daa73d069c600bf9b2a09493bb7

Patch Set 1 #

Total comments: 51

Patch Set 2 : review fix #

Total comments: 18

Patch Set 3 : rebase #

Patch Set 4 : review fix #

Total comments: 10

Patch Set 5 : rebase #

Patch Set 6 : nit fix #

Patch Set 7 : add unit tests #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Patch Set 10 : add more tests #

Total comments: 11

Patch Set 11 : review fix #

Total comments: 4

Patch Set 12 : add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+648 lines, -7 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -0 lines 0 comments Download
A chrome/browser/resource_coordinator/background_tab_navigation_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/browser/resource_coordinator/background_tab_navigation_throttle_unittest.cc View 1 2 3 4 5 6 1 chunk +161 lines, -0 lines 0 comments Download
M chrome/browser/resource_coordinator/tab_manager.h View 1 2 3 4 5 6 7 8 9 10 7 chunks +60 lines, -0 lines 0 comments Download
M chrome/browser/resource_coordinator/tab_manager.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +120 lines, -2 lines 0 comments Download
M chrome/browser/resource_coordinator/tab_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +151 lines, -0 lines 0 comments Download
M chrome/browser/resource_coordinator/tab_manager_web_contents_data.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -5 lines 0 comments Download
M chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +11 lines, -0 lines 0 comments Download
M chrome/common/chrome_features.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/common/chrome_features.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (25 generated)
Zhen Wang
Charlie and Chris, PTAL. :) Will add tests after figuring out the following 2 problems. ...
3 years, 6 months ago (2017-06-09 01:12:06 UTC) #3
Charlie Reis
[+nasko, kenrb] Thanks-- this seems like a good start. I'd like to get Nasko to ...
3 years, 6 months ago (2017-06-10 00:53:35 UTC) #5
kenrb
https://codereview.chromium.org/2931023002/diff/1/content/public/browser/web_contents.h File content/public/browser/web_contents.h (right): https://codereview.chromium.org/2931023002/diff/1/content/public/browser/web_contents.h#newcode445 content/public/browser/web_contents.h:445: virtual bool IsVisible() const = 0; On 2017/06/10 00:53:37, ...
3 years, 6 months ago (2017-06-12 15:26:23 UTC) #6
nasko
https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc File chrome/browser/resource_coordinator/tab_manager.cc (right): https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc#newcode909 chrome/browser/resource_coordinator/tab_manager.cc:909: if (!loading_contents_) { Wouldn't it be simpler to just ...
3 years, 6 months ago (2017-06-12 23:22:02 UTC) #7
Zhen Wang
Thanks for the review! I uploaded a new patch. PTAL https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc File chrome/browser/resource_coordinator/tab_manager.cc (right): https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc#newcode897 ...
3 years, 6 months ago (2017-06-13 23:33:21 UTC) #8
nasko
https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc File chrome/browser/resource_coordinator/tab_manager.cc (right): https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc#newcode935 chrome/browser/resource_coordinator/tab_manager.cc:935: if (navigation_handle && navigation_handle->GetWebContents() == contents) { On 2017/06/13 ...
3 years, 6 months ago (2017-06-15 20:01:58 UTC) #9
kenrb
https://codereview.chromium.org/2931023002/diff/1/content/public/browser/web_contents.h File content/public/browser/web_contents.h (right): https://codereview.chromium.org/2931023002/diff/1/content/public/browser/web_contents.h#newcode445 content/public/browser/web_contents.h:445: virtual bool IsVisible() const = 0; On 2017/06/13 23:33:21, ...
3 years, 6 months ago (2017-06-15 20:53:09 UTC) #10
chrisha
https://codereview.chromium.org/2931023002/diff/20001/chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc File chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc (right): https://codereview.chromium.org/2931023002/diff/20001/chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc#newcode43 chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc:43: // chrome:// UI URLs, for main frames. I would ...
3 years, 6 months ago (2017-06-15 21:02:24 UTC) #11
Zhen Wang
Thanks! I uploaded a new patch. PTAL. https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc File chrome/browser/resource_coordinator/tab_manager.cc (right): https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc#newcode901 chrome/browser/resource_coordinator/tab_manager.cc:901: if (!navigation_handle) ...
3 years, 6 months ago (2017-06-19 23:00:13 UTC) #12
nasko
Just a couple of nits. https://codereview.chromium.org/2931023002/diff/60001/chrome/browser/resource_coordinator/tab_manager.h File chrome/browser/resource_coordinator/tab_manager.h (right): https://codereview.chromium.org/2931023002/diff/60001/chrome/browser/resource_coordinator/tab_manager.h#newcode159 chrome/browser/resource_coordinator/tab_manager.h:159: // clean up the ...
3 years, 6 months ago (2017-06-20 15:59:39 UTC) #13
chrisha
This was mostly looking good, but I just learned that NavThrottles only come into play ...
3 years, 6 months ago (2017-06-20 18:26:54 UTC) #14
nasko
On 2017/06/20 18:26:54, chrisha wrote: > This was mostly looking good, but I just learned ...
3 years, 6 months ago (2017-06-23 19:53:57 UTC) #15
chrisha
Given that we've decided (email thread) to continue down this path, is there anything else ...
3 years, 5 months ago (2017-07-05 17:43:34 UTC) #24
Zhen Wang
On 2017/07/05 17:43:34, chrisha wrote: > Given that we've decided (email thread) to continue down ...
3 years, 5 months ago (2017-07-05 17:50:55 UTC) #25
Zhen Wang
I uploaded a new patch with more tests. PTAL :) https://codereview.chromium.org/2931023002/diff/20001/chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc File chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc (right): https://codereview.chromium.org/2931023002/diff/20001/chrome/browser/resource_coordinator/background_tab_navigation_throttle.cc#newcode50 ...
3 years, 5 months ago (2017-07-06 18:26:12 UTC) #28
Charlie Reis
Sorry-- I got sidetracked for quite a while with traveling and other issues. I also ...
3 years, 5 months ago (2017-07-06 23:50:31 UTC) #31
Zhen Wang
https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc File chrome/browser/resource_coordinator/tab_manager.cc (right): https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_manager.cc#newcode901 chrome/browser/resource_coordinator/tab_manager.cc:901: if (!navigation_handle) On 2017/07/06 23:50:30, Charlie Reis (slow) wrote: ...
3 years, 5 months ago (2017-07-07 18:06:39 UTC) #34
Charlie Reis
Thanks! LGTM at a high level, if Ken is ok with IsVisible(). https://codereview.chromium.org/2931023002/diff/1/chrome/browser/resource_coordinator/tab_navigation_throttle.cc File chrome/browser/resource_coordinator/tab_navigation_throttle.cc ...
3 years, 5 months ago (2017-07-07 22:07:56 UTC) #37
Zhen Wang
Thanks! Ken, can you double check the IsVisible() change? https://codereview.chromium.org/2931023002/diff/200001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/2931023002/diff/200001/chrome/browser/chrome_content_browser_client.cc#newcode3247 chrome/browser/chrome_content_browser_client.cc:3247: ...
3 years, 5 months ago (2017-07-10 17:21:54 UTC) #38
kenrb
lgtm, that method seems reasonable.
3 years, 5 months ago (2017-07-10 17:28:24 UTC) #39
chrisha
Thanks for the thorough unittests! Regarding IsVisible: We couldn't determine that state via the associated ...
3 years, 5 months ago (2017-07-11 14:44:08 UTC) #40
Zhen Wang
On 2017/07/11 14:44:08, chrisha wrote: > Thanks for the thorough unittests! > > Regarding IsVisible: ...
3 years, 5 months ago (2017-07-11 16:47:38 UTC) #41
chrisha
On 2017/07/11 16:47:38, Zhen Wang wrote: > On 2017/07/11 14:44:08, chrisha wrote: > > Thanks ...
3 years, 5 months ago (2017-07-11 17:56:53 UTC) #42
Zhen Wang
On 2017/07/11 17:56:53, chrisha wrote: > On 2017/07/11 16:47:38, Zhen Wang wrote: > > On ...
3 years, 5 months ago (2017-07-11 18:26:39 UTC) #43
chrisha
lgtm!
3 years, 5 months ago (2017-07-11 19:16:49 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2931023002/220001
3 years, 5 months ago (2017-07-11 19:40:00 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/486398)
3 years, 5 months ago (2017-07-11 21:37:29 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2931023002/220001
3 years, 5 months ago (2017-07-12 04:49:09 UTC) #51
commit-bot: I haz the power
3 years, 5 months ago (2017-07-12 05:50:08 UTC) #54
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/6edd49c516047daa73d069c600bf...

Powered by Google App Engine
This is Rietveld 408576698