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 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 | 22 |
23 class GURL; | 23 class GURL; |
24 class Profile; | 24 class Profile; |
25 | 25 |
26 namespace base { | 26 namespace base { |
27 class DictionaryValue; | 27 class DictionaryValue; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
| 31 class BrowserContext; |
31 class RenderProcessHost; | 32 class RenderProcessHost; |
32 class WebContents; | 33 class WebContents; |
33 } | 34 } |
34 | 35 |
35 namespace extensions { | 36 namespace extensions { |
36 class Extension; | 37 class Extension; |
37 class ExtensionHost; | 38 class ExtensionHost; |
38 class LazyBackgroundTaskQueue; | 39 class LazyBackgroundTaskQueue; |
39 | 40 |
40 // This class manages message and event passing between renderer processes. | 41 // This class manages message and event passing between renderer processes. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Allocates a pair of port ids. | 108 // Allocates a pair of port ids. |
108 // NOTE: this can be called from any thread. | 109 // NOTE: this can be called from any thread. |
109 static void AllocatePortIdPair(int* port1, int* port2); | 110 static void AllocatePortIdPair(int* port1, int* port2); |
110 | 111 |
111 explicit MessageService(Profile* profile); | 112 explicit MessageService(Profile* profile); |
112 virtual ~MessageService(); | 113 virtual ~MessageService(); |
113 | 114 |
114 // ProfileKeyedAPI implementation. | 115 // ProfileKeyedAPI implementation. |
115 static ProfileKeyedAPIFactory<MessageService>* GetFactoryInstance(); | 116 static ProfileKeyedAPIFactory<MessageService>* GetFactoryInstance(); |
116 | 117 |
117 // Convenience method to get the MessageService for a profile. | 118 // Convenience method to get the MessageService for a browser context. |
118 static MessageService* Get(Profile* profile); | 119 static MessageService* Get(content::BrowserContext* profile); |
119 | 120 |
120 // Given an extension's ID, opens a channel between the given renderer "port" | 121 // Given an extension's ID, opens a channel between the given renderer "port" |
121 // and every listening context owned by that extension. |channel_name| is | 122 // and every listening context owned by that extension. |channel_name| is |
122 // an optional identifier for use by extension developers. | 123 // an optional identifier for use by extension developers. |
123 void OpenChannelToExtension( | 124 void OpenChannelToExtension( |
124 int source_process_id, int source_routing_id, int receiver_port_id, | 125 int source_process_id, int source_routing_id, int receiver_port_id, |
125 const std::string& source_extension_id, | 126 const std::string& source_extension_id, |
126 const std::string& target_extension_id, | 127 const std::string& target_extension_id, |
127 const GURL& source_url, | 128 const GURL& source_url, |
128 const std::string& channel_name, | 129 const std::string& channel_name, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 LazyBackgroundTaskQueue* lazy_background_task_queue_; | 267 LazyBackgroundTaskQueue* lazy_background_task_queue_; |
267 | 268 |
268 base::WeakPtrFactory<MessageService> weak_factory_; | 269 base::WeakPtrFactory<MessageService> weak_factory_; |
269 | 270 |
270 DISALLOW_COPY_AND_ASSIGN(MessageService); | 271 DISALLOW_COPY_AND_ASSIGN(MessageService); |
271 }; | 272 }; |
272 | 273 |
273 } // namespace extensions | 274 } // namespace extensions |
274 | 275 |
275 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ | 276 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
OLD | NEW |