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

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

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 1 month 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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 namespace { 157 namespace {
158 158
159 static base::StaticAtomicSequenceNumber g_next_channel_id; 159 static base::StaticAtomicSequenceNumber g_next_channel_id;
160 static base::StaticAtomicSequenceNumber g_channel_id_overflow_count; 160 static base::StaticAtomicSequenceNumber g_channel_id_overflow_count;
161 161
162 static content::RenderProcessHost* GetExtensionProcess( 162 static content::RenderProcessHost* GetExtensionProcess(
163 BrowserContext* context, 163 BrowserContext* context,
164 const std::string& extension_id) { 164 const std::string& extension_id) {
165 SiteInstance* site_instance = 165 SiteInstance* site_instance =
166 ExtensionSystem::Get(context)->process_manager()->GetSiteInstanceForURL( 166 ProcessManager::Get(context)->GetSiteInstanceForURL(
167 Extension::GetBaseURLFromExtensionId(extension_id)); 167 Extension::GetBaseURLFromExtensionId(extension_id));
168 return site_instance->HasProcess() ? site_instance->GetProcess() : NULL; 168 return site_instance->HasProcess() ? site_instance->GetProcess() : NULL;
169 } 169 }
170 170
171 } // namespace 171 } // namespace
172 172
173 content::RenderProcessHost* 173 content::RenderProcessHost*
174 MessageService::MessagePort::GetRenderProcessHost() { 174 MessageService::MessagePort::GetRenderProcessHost() {
175 return NULL; 175 return NULL;
176 } 176 }
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 791 }
792 792
793 void MessageService::DispatchOnDisconnect(content::RenderProcessHost* source, 793 void MessageService::DispatchOnDisconnect(content::RenderProcessHost* source,
794 int port_id, 794 int port_id,
795 const std::string& error_message) { 795 const std::string& error_message) {
796 ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, ""); 796 ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, "");
797 port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(port_id), error_message); 797 port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(port_id), error_message);
798 } 798 }
799 799
800 } // namespace extensions 800 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698