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

Issue 1931503002: Add BackgroundModeOptimizer that can restart the browser (Closed)

Created:
4 years, 7 months ago by dgn
Modified:
4 years, 4 months ago
Reviewers:
Bernhard Bauer, sky
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@PushKeepAlive
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add BackgroundModeOptimizer that can restart the browser Its initialization is behind the BackgroundModeAllowRestart flag, and is supported only on Windows and Linux BUG=585080 Committed: https://crrev.com/3eaf67ed9424c847489410ec5956ddd1bf9a1557 Cr-Commit-Position: refs/heads/master@{#407742}

Patch Set 1 : #

Patch Set 2 : Switch the flag to disabled by default #

Total comments: 15

Patch Set 3 : Remove the global background restart boolean, address comments #

Patch Set 4 : rebase #

Patch Set 5 : rebase #

Patch Set 6 : remove test #

Patch Set 7 : fix android compilation #

Patch Set 8 : rebase #

Patch Set 9 : Add BackgroundModeOptimizer that can restart the browser #

Patch Set 10 : enable flag by default, reset prefs if close is cancelled #

Patch Set 11 : cleanup, enable by default #

Patch Set 12 : cleanup, enable by default (that's just to verify the tests) #

Total comments: 12

Patch Set 13 : Rebase, address comments, add small test #

Patch Set 14 : fix android compilation #

Patch Set 15 : fix BrowserListTest.AttemptRestart #

Total comments: 10

Patch Set 16 : address comments. disable feature by default #

Unified diffs Side-by-side diffs Delta from patch set Stats (+301 lines, -13 lines) Patch
M chrome/browser/background/background_mode_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +21 lines, -1 line 0 comments Download
M chrome/browser/background/background_mode_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/background/background_mode_manager_unittest.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
A chrome/browser/background/background_mode_optimizer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/browser/background/background_mode_optimizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +89 lines, -0 lines 0 comments Download
A chrome/browser/background/background_mode_optimizer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/browser/browser_shutdown.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +16 lines, -3 lines 0 comments Download
M chrome/browser/browser_shutdown.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +26 lines, -2 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +18 lines, -1 line 0 comments Download
M chrome/browser/lifetime/browser_close_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/lifetime/keep_alive_registry.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_features.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/chrome_features.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (24 generated)
dgn
PTAL. PatchSet1 has the tests passing with the flag enabled
4 years, 7 months ago (2016-05-18 15:17:25 UTC) #6
sky
I'm not familiar with this work. Is there a design doc you can point me ...
4 years, 7 months ago (2016-05-18 15:29:52 UTC) #7
dgn
On 2016/05/18 15:29:52, sky wrote: > I'm not familiar with this work. Is there a ...
4 years, 7 months ago (2016-05-18 15:30:52 UTC) #8
sky
On 2016/05/18 15:30:52, dgn wrote: > On 2016/05/18 15:29:52, sky wrote: > > I'm not ...
4 years, 7 months ago (2016-05-18 19:16:28 UTC) #9
sky
Can you write a browser test? It would be good to verify that chrome restarts ...
4 years, 7 months ago (2016-05-18 19:23:06 UTC) #10
Bernhard Bauer
https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_manager.h File chrome/browser/background/background_mode_manager.h (right): https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_manager.h#newcode92 chrome/browser/background/background_mode_manager.h:92: // Invoked to take Chrome out of KeepAlive mode ...
4 years, 7 months ago (2016-05-19 08:56:56 UTC) #11
dgn
PTAL. Test still TBD https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_manager.h File chrome/browser/background/background_mode_manager.h (right): https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_manager.h#newcode92 chrome/browser/background/background_mode_manager.h:92: // Invoked to take Chrome ...
4 years, 6 months ago (2016-06-20 17:45:19 UTC) #12
sky
https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_optimizer.cc File chrome/browser/background/background_mode_optimizer.cc (right): https://codereview.chromium.org/1931503002/diff/80001/chrome/browser/background/background_mode_optimizer.cc#newcode67 chrome/browser/background/background_mode_optimizer.cc:67: g_browser_process->background_mode_manager()->EndBackgroundMode(); On 2016/06/20 17:45:18, dgn wrote: > On 2016/05/18 ...
4 years, 6 months ago (2016-06-20 19:31:55 UTC) #13
dgn
On 2016/06/20 19:31:55, sky wrote: > I think you should make AttemptRestart return a status. ...
4 years, 5 months ago (2016-07-05 19:54:12 UTC) #14
sky
https://codereview.chromium.org/1931503002/diff/280001/chrome/browser/background/background_mode_manager.h File chrome/browser/background/background_mode_manager.h (right): https://codereview.chromium.org/1931503002/diff/280001/chrome/browser/background/background_mode_manager.h#newcode85 chrome/browser/background/background_mode_manager.h:85: static bool ShouldRestartInBackground(); nit: inline these are these are ...
4 years, 5 months ago (2016-07-06 16:55:33 UTC) #15
dgn
PTAL https://codereview.chromium.org/1931503002/diff/280001/chrome/browser/background/background_mode_manager.h File chrome/browser/background/background_mode_manager.h (right): https://codereview.chromium.org/1931503002/diff/280001/chrome/browser/background/background_mode_manager.h#newcode85 chrome/browser/background/background_mode_manager.h:85: static bool ShouldRestartInBackground(); On 2016/07/06 16:55:33, sky wrote: ...
4 years, 5 months ago (2016-07-22 15:18:09 UTC) #26
sky
https://codereview.chromium.org/1931503002/diff/340001/chrome/browser/background/background_mode_manager.cc File chrome/browser/background/background_mode_manager.cc (right): https://codereview.chromium.org/1931503002/diff/340001/chrome/browser/background/background_mode_manager.cc#newcode96 chrome/browser/background/background_mode_manager.cc:96: bool BackgroundModeManager::should_restart_in_background_ = false; in general we prefix statics ...
4 years, 5 months ago (2016-07-22 16:57:52 UTC) #29
dgn
PTAL https://codereview.chromium.org/1931503002/diff/340001/chrome/browser/background/background_mode_manager.cc File chrome/browser/background/background_mode_manager.cc (right): https://codereview.chromium.org/1931503002/diff/340001/chrome/browser/background/background_mode_manager.cc#newcode96 chrome/browser/background/background_mode_manager.cc:96: bool BackgroundModeManager::should_restart_in_background_ = false; On 2016/07/22 16:57:52, sky ...
4 years, 5 months ago (2016-07-25 17:32:28 UTC) #34
sky
LGTM
4 years, 5 months ago (2016-07-25 20:05:03 UTC) #35
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/1931503002/360001
4 years, 4 months ago (2016-07-26 08:57:38 UTC) #37
dgn
On 2016/07/25 20:05:03, sky wrote: > LGTM Thanks!
4 years, 4 months ago (2016-07-26 08:59:52 UTC) #38
commit-bot: I haz the power
Failed to apply the patch.
4 years, 4 months ago (2016-07-26 09:02:46 UTC) #40
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 09:04:38 UTC) #42
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/3eaf67ed9424c847489410ec5956ddd1bf9a1557
Cr-Commit-Position: refs/heads/master@{#407742}

Powered by Google App Engine
This is Rietveld 408576698