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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 155707: Changed the extension.connect() API not to broadcast to all tabs. Added a (Closed)
Patch Set: review comments Created 11 years, 5 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 | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/browser_render_process_host.cc
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index bad0e3e5dcfe07fb6023901999008a2e4bc4795a..f8142f5fd0b837f06efb0a5e629e45f7e1820936 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -963,17 +963,22 @@ void BrowserRenderProcessHost::Observe(NotificationType type,
void BrowserRenderProcessHost::OnExtensionAddListener(
const std::string& event_name) {
- ExtensionMessageService::GetInstance(profile()->GetRequestContext())->
- AddEventListener(event_name, pid());
+ if (profile()->GetExtensionMessageService()) {
+ profile()->GetExtensionMessageService()->AddEventListener(event_name,
+ pid());
+ }
}
void BrowserRenderProcessHost::OnExtensionRemoveListener(
const std::string& event_name) {
- ExtensionMessageService::GetInstance(profile()->GetRequestContext())->
- RemoveEventListener(event_name, pid());
+ if (profile()->GetExtensionMessageService()) {
+ profile()->GetExtensionMessageService()->RemoveEventListener(event_name,
+ pid());
+ }
}
void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) {
- ExtensionMessageService::GetInstance(profile()->GetRequestContext())->
- CloseChannel(port_id);
+ if (profile()->GetExtensionMessageService()) {
+ profile()->GetExtensionMessageService()->CloseChannel(port_id);
+ }
}
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698