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

Unified Diff: extensions/browser/extension_host.cc

Issue 933423003: Make BackgroundContentsService start up BackgroundContents with a delay, as for ExtensionHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: delegate + rename Created 5 years, 10 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/extension_host.cc
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc
index 84b95313ab9a351d816c21a04c0c8559a02b854c..ba1bae4334538860e77be7d76115fbfe52d562fe 100644
--- a/extensions/browser/extension_host.cc
+++ b/extensions/browser/extension_host.cc
@@ -50,17 +50,6 @@ using content::WebContents;
namespace extensions {
-namespace {
-
-// Singleton which wraps our current ExtensionHostQueue implementation.
-struct QueueWrapper {
- QueueWrapper() : queue(new SerialExtensionHostQueue()) {}
- scoped_ptr<ExtensionHostQueue> queue;
-};
-base::LazyInstance<QueueWrapper> g_queue_wrapper = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
ExtensionHost::ExtensionHost(const Extension* extension,
SiteInstance* site_instance,
const GURL& url,
@@ -110,7 +99,7 @@ ExtensionHost::~ExtensionHost() {
content::Details<ExtensionHost>(this));
FOR_EACH_OBSERVER(ExtensionHostObserver, observer_list_,
OnExtensionHostDestroyed(this));
- g_queue_wrapper.Get().queue->Remove(this);
+ delegate_->GetExtensionHostQueue()->Remove(this);
// Immediately stop observing |host_contents_| because its destruction events
// (like DidStopLoading, it turns out) can call back into ExtensionHost
// re-entrantly, when anything declared after |host_contents_| has already
@@ -138,7 +127,7 @@ void ExtensionHost::CreateRenderViewSoon() {
// to defer.
CreateRenderViewNow();
} else {
- g_queue_wrapper.Get().queue->Add(this);
+ delegate_->GetExtensionHostQueue()->Add(this);
}
}

Powered by Google App Engine
This is Rietveld 408576698