Reland: Refactor code that defers extension background page loading
commit6b54fda654446046577e4b9c10c48eb61b022ebb
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 22 Jul 2014 02:13:47 +0000 (22 02:13 +0000)
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 22 Jul 2014 02:13:47 +0000 (22 02:13 +0000)
tree4707735b1e04dc6669d4baebc6e28dfa31f19c55
parente25bbc6831ccc2d0a924c3b0d8ce79469beff32c
Reland: 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.

(Original CL https://codereview.chromium.org/381283002 broke valgrind bots
because it was initializing left-over BrowserContextKeyedServices from tests
running earlier in the same process.)

BUG=392658
TEST=unit_tests ProcessManagerTest, browser_tests ProcessManagerBrowserTest, manual

Review URL: https://codereview.chromium.org/408523005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284593 0039d316-1c4b-4281-b951-d872f2087c98
20 files changed:
apps/shell/browser/shell_extensions_browser_client.cc
apps/shell/browser/shell_extensions_browser_client.h
chrome/browser/extensions/chrome_extensions_browser_client.cc
chrome/browser/extensions/chrome_extensions_browser_client.h
chrome/browser/extensions/chrome_notification_observer.cc
chrome/browser/extensions/chrome_notification_observer.h
chrome/browser/extensions/chrome_process_manager_delegate.cc [new file with mode: 0644]
chrome/browser/extensions/chrome_process_manager_delegate.h [new file with mode: 0644]
chrome/chrome_browser_extensions.gypi
extensions/DEPS
extensions/browser/extension_registry.h
extensions/browser/extensions_browser_client.h
extensions/browser/lazy_background_task_queue_unittest.cc
extensions/browser/process_manager.cc
extensions/browser/process_manager.h
extensions/browser/process_manager_delegate.h [new file with mode: 0644]
extensions/browser/process_manager_unittest.cc
extensions/browser/test_extensions_browser_client.cc
extensions/browser/test_extensions_browser_client.h
extensions/extensions.gyp