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

Unified Diff: extensions/browser/lazy_background_task_queue.cc

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 2 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/lazy_background_task_queue.cc
diff --git a/extensions/browser/lazy_background_task_queue.cc b/extensions/browser/lazy_background_task_queue.cc
index 5ac92de54bf2c805573d6e17b03850d7049d8583..754e59264b50b951f51ed430804d109a5e66ec95 100644
--- a/extensions/browser/lazy_background_task_queue.cc
+++ b/extensions/browser/lazy_background_task_queue.cc
@@ -13,7 +13,6 @@
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
@@ -47,9 +46,7 @@ bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
// extension tasks.
DCHECK(extension);
if (BackgroundInfo::HasBackgroundPage(extension)) {
- ProcessManager* pm = ExtensionSystem::Get(
- browser_context)->process_manager();
- DCHECK(pm);
+ ProcessManager* pm = ProcessManager::Get(browser_context);
ExtensionHost* background_host =
pm->GetBackgroundHostForExtension(extension->id());
if (!background_host || !background_host->did_stop_loading())
@@ -82,8 +79,7 @@ void LazyBackgroundTaskQueue::AddPendingTask(
if (extension && BackgroundInfo::HasLazyBackgroundPage(extension)) {
// If this is the first enqueued task, and we're not waiting for the
// background page to unload, ensure the background page is loaded.
- ProcessManager* pm = ExtensionSystem::Get(
- browser_context)->process_manager();
+ ProcessManager* pm = ProcessManager::Get(browser_context);
pm->IncrementLazyKeepaliveCount(extension);
// Creating the background host may fail, e.g. if |profile| is incognito
// but the extension isn't enabled in incognito mode.
@@ -130,8 +126,8 @@ void LazyBackgroundTaskQueue::ProcessPendingTasks(
// Balance the keepalive in AddPendingTask. Note we don't do this on a
// failure to load, because the keepalive count is reset in that case.
if (host && BackgroundInfo::HasLazyBackgroundPage(extension)) {
- ExtensionSystem::Get(browser_context)->process_manager()->
- DecrementLazyKeepaliveCount(extension);
+ ProcessManager::Get(browser_context)
+ ->DecrementLazyKeepaliveCount(extension);
}
}

Powered by Google App Engine
This is Rietveld 408576698