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

Side by Side Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 11246003: Remove Profile->GetExtensionProcessManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix extension_crash_recovery_browsertest Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/messaging/message_service.h" 5 #include "chrome/browser/extensions/api/messaging/message_service.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 channel_name(channel_name) {} 81 channel_name(channel_name) {}
82 }; 82 };
83 83
84 namespace { 84 namespace {
85 85
86 static base::StaticAtomicSequenceNumber g_next_channel_id; 86 static base::StaticAtomicSequenceNumber g_next_channel_id;
87 87
88 static content::RenderProcessHost* GetExtensionProcess( 88 static content::RenderProcessHost* GetExtensionProcess(
89 Profile* profile, const std::string& extension_id) { 89 Profile* profile, const std::string& extension_id) {
90 SiteInstance* site_instance = 90 SiteInstance* site_instance =
91 profile->GetExtensionProcessManager()->GetSiteInstanceForURL( 91 extensions::ExtensionSystem::Get(profile)->process_manager()->
92 Extension::GetBaseURLFromExtensionId(extension_id)); 92 GetSiteInstanceForURL(
93 Extension::GetBaseURLFromExtensionId(extension_id));
93 94
94 if (!site_instance->HasProcess()) 95 if (!site_instance->HasProcess())
95 return NULL; 96 return NULL;
96 97
97 return site_instance->GetProcess(); 98 return site_instance->GetProcess();
98 } 99 }
99 100
100 } // namespace 101 } // namespace
101 102
102 content::RenderProcessHost* 103 content::RenderProcessHost*
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 return; 501 return;
501 502
502 params->source = source; 503 params->source = source;
503 params->receiver.reset(new ExtensionMessagePort(host->render_process_host(), 504 params->receiver.reset(new ExtensionMessagePort(host->render_process_host(),
504 MSG_ROUTING_CONTROL, 505 MSG_ROUTING_CONTROL,
505 params->target_extension_id)); 506 params->target_extension_id));
506 OpenChannelImpl(params.Pass()); 507 OpenChannelImpl(params.Pass());
507 } 508 }
508 509
509 } // namespace extensions 510 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698