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

Unified Diff: extensions/browser/lazy_background_task_queue.cc

Issue 147923005: Split ExtensionSystem interface from ExtensionSystemImpl implementation, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 2a525031147814e329933ce349b2bf79643a3da2..2b38ce9ad189d3a08fd61a142b6b089fc3235cc6 100644
--- a/extensions/browser/lazy_background_task_queue.cc
+++ b/extensions/browser/lazy_background_task_queue.cc
@@ -7,7 +7,6 @@
#include "base/callback.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_system.h"
#include "chrome/common/extensions/extension_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
@@ -16,6 +15,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
@@ -44,7 +44,7 @@ bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
const Extension* extension) {
DCHECK(extension);
if (BackgroundInfo::HasBackgroundPage(extension)) {
- ProcessManager* pm = ExtensionSystem::GetForBrowserContext(
+ ProcessManager* pm = ExtensionSystem::Get(
browser_context)->process_manager();
DCHECK(pm);
ExtensionHost* background_host =
@@ -79,7 +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::GetForBrowserContext(
+ ProcessManager* pm = ExtensionSystem::Get(
browser_context)->process_manager();
pm->IncrementLazyKeepaliveCount(extension);
// Creating the background host may fail, e.g. if |profile| is incognito
@@ -127,7 +127,7 @@ 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::GetForBrowserContext(browser_context)->process_manager()->
+ ExtensionSystem::Get(browser_context)->process_manager()->
DecrementLazyKeepaliveCount(extension);
}
}

Powered by Google App Engine
This is Rietveld 408576698