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

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 126137: Part 1 of merging Extensions and DOMUI (Closed)
Patch Set: add test and rebase Created 11 years, 6 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: chrome/browser/extensions/extension_function_dispatcher.cc
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 7b873a5a1d1e14ac82ae19b3dee8e9cba40c4892..24eacf20faffa36b5c4cab941bbb77a811641e2e 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -168,23 +168,31 @@ void ExtensionFunctionDispatcher::ResetFunctions() {
FactoryRegistry::instance()->ResetFunctions();
}
+std::set<ExtensionFunctionDispatcher*>*
+ ExtensionFunctionDispatcher::all_instances() {
+ static std::set<ExtensionFunctionDispatcher*> instances;
+ return &instances;
+}
+
ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(
RenderViewHost* render_view_host,
Delegate* delegate,
- const std::string& extension_id)
+ const GURL& url)
: render_view_host_(render_view_host),
delegate_(delegate),
- extension_id_(extension_id),
+ url_(url),
ALLOW_THIS_IN_INITIALIZER_LIST(peer_(new Peer(this))) {
+ all_instances()->insert(this);
RenderProcessHost* process = render_view_host_->process();
ExtensionMessageService* message_service =
ExtensionMessageService::GetInstance(profile()->GetRequestContext());
DCHECK(process);
DCHECK(message_service);
- message_service->RegisterExtension(extension_id, process->pid());
+ message_service->RegisterExtension(extension_id(), process->pid());
}
ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() {
+ all_instances()->erase(this);
peer_->dispatcher_ = NULL;
}
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698