| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |