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

Unified Diff: extensions/browser/lazy_background_task_queue.cc

Issue 1016473002: Make LoadMonitoringExtensionHostQueue remove itself as an ExtensionHost observer at the correct tim… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another rename Created 5 years, 9 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 | « extensions/browser/extension_host.cc ('k') | extensions/browser/load_monitoring_extension_host_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 754e59264b50b951f51ed430804d109a5e66ec95..b76b6d36743746c7650e670b99d0e2d9a46949e2 100644
--- a/extensions/browser/lazy_background_task_queue.cc
+++ b/extensions/browser/lazy_background_task_queue.cc
@@ -27,7 +27,7 @@ LazyBackgroundTaskQueue::LazyBackgroundTaskQueue(
content::BrowserContext* browser_context)
: browser_context_(browser_context), extension_registry_observer_(this) {
registrar_.Add(this,
- extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
+ extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD,
content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
@@ -49,7 +49,7 @@ bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
ProcessManager* pm = ProcessManager::Get(browser_context);
ExtensionHost* background_host =
pm->GetBackgroundHostForExtension(extension->id());
- if (!background_host || !background_host->did_stop_loading())
+ if (!background_host || !background_host->has_loaded_once())
return true;
if (pm->IsBackgroundHostClosing(extension->id()))
pm->CancelSuspend(extension);
@@ -136,13 +136,13 @@ void LazyBackgroundTaskQueue::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD: {
// If an on-demand background page finished loading, dispatch queued up
// events for it.
ExtensionHost* host =
content::Details<ExtensionHost>(details).ptr();
if (host->extension_host_type() == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
- CHECK(host->did_stop_loading());
+ CHECK(host->has_loaded_once());
ProcessPendingTasks(host, host->browser_context(), host->extension());
}
break;
« no previous file with comments | « extensions/browser/extension_host.cc ('k') | extensions/browser/load_monitoring_extension_host_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698