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

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

Issue 7480028: Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: chrome/browser/extensions/extension_message_service.cc
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index 0dd960d15e2c7d0c6dd72c4a4e9efa8319988c6c..58400e5e9037edb95762d5ec655f5eec45958f2f 100644
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -143,12 +143,13 @@ void ExtensionMessageService::OpenChannelToExtension(
RenderProcessHost* source = RenderProcessHost::FromID(source_process_id);
if (!source)
return;
+ Profile* profile = Profile::FromBrowserContext(source->browser_context());
// Note: we use the source's profile here. If the source is an incognito
// process, we will use the incognito EPM to find the right extension process,
// which depends on whether the extension uses spanning or split mode.
MessagePort receiver(
- source->profile()->GetExtensionProcessManager()->GetExtensionProcess(
+ profile->GetExtensionProcessManager()->GetExtensionProcess(
target_extension_id),
MSG_ROUTING_CONTROL);
TabContents* source_contents = tab_util::GetTabContentsByID(
@@ -173,10 +174,11 @@ void ExtensionMessageService::OpenChannelToTab(
RenderProcessHost* source = RenderProcessHost::FromID(source_process_id);
if (!source)
return;
+ Profile* profile = Profile::FromBrowserContext(source->browser_context());
TabContentsWrapper* contents = NULL;
MessagePort receiver;
- if (ExtensionTabUtil::GetTabById(tab_id, source->profile(), true,
+ if (ExtensionTabUtil::GetTabById(tab_id, profile, true,
NULL, NULL, &contents, NULL)) {
receiver.sender = contents->render_view_host();
receiver.routing_id = contents->render_view_host()->routing_id();

Powered by Google App Engine
This is Rietveld 408576698