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

Unified Diff: extensions/browser/api/runtime/runtime_api.cc

Issue 1129063011: Extract LazyBackgroundTaskQueue from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased from master Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/signin/easy_unlock_app_manager_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/runtime/runtime_api.cc
diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc
index cc90d3732c2e5824609fc4a5bcd590550cc02628..6e23721f2a9348514a0e1dfcfed7a4b8614ed967 100644
--- a/extensions/browser/api/runtime/runtime_api.cc
+++ b/extensions/browser/api/runtime/runtime_api.cc
@@ -95,13 +95,12 @@ void DispatchOnStartupEventImpl(BrowserContext* browser_context,
extension_id);
if (extension && BackgroundInfo::HasPersistentBackgroundPage(extension) &&
first_call &&
- system->lazy_background_task_queue()->ShouldEnqueueTask(browser_context,
- extension)) {
- system->lazy_background_task_queue()->AddPendingTask(
- browser_context,
- extension_id,
- base::Bind(
- &DispatchOnStartupEventImpl, browser_context, extension_id, false));
+ LazyBackgroundTaskQueue::Get(browser_context)
+ ->ShouldEnqueueTask(browser_context, extension)) {
+ LazyBackgroundTaskQueue::Get(browser_context)
+ ->AddPendingTask(browser_context, extension_id,
+ base::Bind(&DispatchOnStartupEventImpl,
+ browser_context, extension_id, false));
return;
}
@@ -404,15 +403,14 @@ void RuntimeEventRouter::OnExtensionUninstalled(
}
ExtensionFunction::ResponseAction RuntimeGetBackgroundPageFunction::Run() {
- ExtensionSystem* system = ExtensionSystem::Get(browser_context());
ExtensionHost* host = ProcessManager::Get(browser_context())
->GetBackgroundHostForExtension(extension_id());
- if (system->lazy_background_task_queue()->ShouldEnqueueTask(browser_context(),
- extension())) {
- system->lazy_background_task_queue()->AddPendingTask(
- browser_context(),
- extension_id(),
- base::Bind(&RuntimeGetBackgroundPageFunction::OnPageLoaded, this));
+ if (LazyBackgroundTaskQueue::Get(browser_context())
+ ->ShouldEnqueueTask(browser_context(), extension())) {
+ LazyBackgroundTaskQueue::Get(browser_context())
+ ->AddPendingTask(
+ browser_context(), extension_id(),
+ base::Bind(&RuntimeGetBackgroundPageFunction::OnPageLoaded, this));
} else if (host) {
OnPageLoaded(host);
} else {
« no previous file with comments | « chrome/browser/signin/easy_unlock_app_manager_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698