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); |
+ } |
} |