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

Issue 381283002: Refactor code that defers extension background page loading (Closed)

Created:
6 years, 5 months ago by James Cook
Modified:
6 years, 5 months ago
Reviewers:
Yoyo Zhou
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Project:
chromium
Visibility:
Public.

Description

Refactor code that defers extension background page loading src/extensions depends on chrome::NOTIFICATION_PROFILE_CREATED to support deferred loading of extension background pages when the profile isn't ready yet. This is a layering violation. * Remove Chrome concepts like "browser window ready" and "profile created" from ProcessManager. Introduce ProcessManagerDelegate with a general concept of deferring background page loading. * Consolidate all the tricky Chrome-specific background page loading rules into ChromeProcessManagerDelegate. This keeps all the rules in one place. Annotate each block of special case code with the bug that inspired it. * Extend unit test coverage for ProcessManager. This will make it easier to eliminate chrome::NOTIFICATION_PROFILE_DESTROYED in ProcessManager in a later CL. BUG=392658 TEST=unit_tests ProcessManagerTest, browser_tests ProcessManagerBrowserTest, manual Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283678

Patch Set 1 #

Patch Set 2 : more tests #

Patch Set 3 : larger DeferLoadingBackgroundHosts #

Total comments: 10

Patch Set 4 : ProcessManagerDelegate #

Patch Set 5 : cleanup, fix android #

Total comments: 7

Patch Set 6 : review comments #

Patch Set 7 : rebase #

Patch Set 8 : rebase on top of chrome_browser_extensions.gypi GN changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+443 lines, -174 lines) Patch
M apps/shell/browser/shell_extensions_browser_client.h View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M apps/shell/browser/shell_extensions_browser_client.cc View 1 2 3 1 chunk +3 lines, -8 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.h View 1 2 3 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.cc View 1 2 3 4 3 chunks +7 lines, -26 lines 0 comments Download
M chrome/browser/extensions/chrome_notification_observer.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/chrome_notification_observer.cc View 1 2 3 2 chunks +0 lines, -43 lines 0 comments Download
A chrome/browser/extensions/chrome_process_manager_delegate.h View 1 2 3 4 5 6 1 chunk +50 lines, -0 lines 0 comments Download
A chrome/browser/extensions/chrome_process_manager_delegate.cc View 1 2 3 4 1 chunk +143 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/DEPS View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M extensions/browser/extensions_browser_client.h View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M extensions/browser/process_manager.h View 1 2 3 4 5 6 6 chunks +12 lines, -9 lines 0 comments Download
M extensions/browser/process_manager.cc View 1 2 3 4 5 6 10 chunks +42 lines, -56 lines 0 comments Download
A extensions/browser/process_manager_delegate.h View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M extensions/browser/process_manager_unittest.cc View 1 2 3 4 5 5 chunks +121 lines, -1 line 0 comments Download
M extensions/browser/test_extensions_browser_client.h View 1 2 3 3 chunks +9 lines, -5 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.cc View 1 2 3 2 chunks +6 lines, -9 lines 0 comments Download
M extensions/extensions.gyp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
James Cook
yoz, could I get some early feedback on the test pieces of this? I've added ...
6 years, 5 months ago (2014-07-11 00:04:24 UTC) #1
Yoyo Zhou
https://codereview.chromium.org/381283002/diff/40001/extensions/DEPS File extensions/DEPS (right): https://codereview.chromium.org/381283002/diff/40001/extensions/DEPS#newcode3 extensions/DEPS:3: "-chrome", I think this is superfluous but the comment ...
6 years, 5 months ago (2014-07-11 01:51:53 UTC) #2
James Cook
yoz, PTAL. I updated the CL description too. It's a moderate amount of code change, ...
6 years, 5 months ago (2014-07-11 21:19:29 UTC) #3
James Cook
Friendly ping?
6 years, 5 months ago (2014-07-14 22:35:33 UTC) #4
Yoyo Zhou
LGTM https://codereview.chromium.org/381283002/diff/80001/chrome/browser/extensions/chrome_process_manager_delegate.cc File chrome/browser/extensions/chrome_process_manager_delegate.cc (right): https://codereview.chromium.org/381283002/diff/80001/chrome/browser/extensions/chrome_process_manager_delegate.cc#newcode26 chrome/browser/extensions/chrome_process_manager_delegate.cc:26: ChromeProcessManagerDelegate::ChromeProcessManagerDelegate() { I like this much better than ...
6 years, 5 months ago (2014-07-15 02:13:22 UTC) #5
James Cook
Thanks! https://codereview.chromium.org/381283002/diff/80001/extensions/browser/process_manager.h File extensions/browser/process_manager.h (right): https://codereview.chromium.org/381283002/diff/80001/extensions/browser/process_manager.h#newcode39 extensions/browser/process_manager.h:39: class ProcessManagerDelegate { On 2014/07/15 02:13:22, Yoyo Zhou ...
6 years, 5 months ago (2014-07-15 17:02:53 UTC) #6
James Cook
The CQ bit was checked by jamescook@chromium.org
6 years, 5 months ago (2014-07-15 17:15:17 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamescook@chromium.org/381283002/120001
6 years, 5 months ago (2014-07-15 17:16:41 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-16 05:09:43 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-16 05:14:09 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/171004)
6 years, 5 months ago (2014-07-16 05:14:11 UTC) #11
James Cook
The CQ bit was checked by jamescook@chromium.org
6 years, 5 months ago (2014-07-16 17:13:24 UTC) #12
James Cook
The CQ bit was unchecked by jamescook@chromium.org
6 years, 5 months ago (2014-07-16 17:13:58 UTC) #13
James Cook
The CQ bit was checked by jamescook@chromium.org
6 years, 5 months ago (2014-07-16 17:18:57 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamescook@chromium.org/381283002/160001
6 years, 5 months ago (2014-07-16 17:22:19 UTC) #15
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-16 19:18:44 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-16 19:48:23 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/171690)
6 years, 5 months ago (2014-07-16 19:48:24 UTC) #18
James Cook
The CQ bit was checked by jamescook@chromium.org
6 years, 5 months ago (2014-07-16 20:40:36 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamescook@chromium.org/381283002/160001
6 years, 5 months ago (2014-07-16 20:42:32 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-16 23:09:27 UTC) #21
commit-bot: I haz the power
Change committed as 283678
6 years, 5 months ago (2014-07-17 07:05:52 UTC) #22
James Cook
6 years, 5 months ago (2014-07-17 17:23:31 UTC) #23
Message was sent while issue was closed.
On 2014/07/17 07:05:52, I haz the power (commit-bot) wrote:
> Change committed as 283678

Reverted in 283801.

This broke Chrome OS valgrind bots, for example:
http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28v...

Powered by Google App Engine
This is Rietveld 408576698