OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_MESSAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
18 | 18 |
19 class GURL; | |
20 class Profile; | 19 class Profile; |
21 class TabContents; | 20 class TabContents; |
22 | 21 |
23 // This class manages message and event passing between renderer processes. | 22 // This class manages message and event passing between renderer processes. |
24 // It maintains a list of processes that are listening to events and a set of | 23 // It maintains a list of processes that are listening to events and a set of |
25 // open channels. | 24 // open channels. |
26 // | 25 // |
27 // Messaging works this way: | 26 // Messaging works this way: |
28 // - An extension-owned script context (like a background page or a content | 27 // - An extension-owned script context (like a background page or a content |
29 // script) adds an event listener to the "onConnect" event. | 28 // script) adds an event listener to the "onConnect" event. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Profile* profile_; | 144 Profile* profile_; |
146 | 145 |
147 content::NotificationRegistrar registrar_; | 146 content::NotificationRegistrar registrar_; |
148 | 147 |
149 MessageChannelMap channels_; | 148 MessageChannelMap channels_; |
150 | 149 |
151 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); | 150 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); |
152 }; | 151 }; |
153 | 152 |
154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
OLD | NEW |