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

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: 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
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..09ed7d99b0e35a6e1e9498be5c678496762a9a6d 100644
--- a/extensions/browser/api/runtime/runtime_api.cc
+++ b/extensions/browser/api/runtime/runtime_api.cc
@@ -95,9 +95,9 @@ 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(
+ LazyBackgroundTaskQueue::Get(browser_context)->ShouldEnqueueTask(
+ browser_context, extension)) {
+ LazyBackgroundTaskQueue::Get(browser_context)->AddPendingTask(
browser_context,
extension_id,
base::Bind(
@@ -404,12 +404,11 @@ 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(
+ if (LazyBackgroundTaskQueue::Get(browser_context())->ShouldEnqueueTask(
+ browser_context(), extension())) {
+ LazyBackgroundTaskQueue::Get(browser_context())->AddPendingTask(
browser_context(),
extension_id(),
base::Bind(&RuntimeGetBackgroundPageFunction::OnPageLoaded, this));

Powered by Google App Engine
This is Rietveld 408576698