| 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> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 public NotificationObserver { | 49 public NotificationObserver { |
| 50 public: | 50 public: |
| 51 // A messaging channel. Note that the opening port can be the same as the | 51 // A messaging channel. Note that the opening port can be the same as the |
| 52 // receiver, if an extension toolstrip wants to talk to its tab (for example). | 52 // receiver, if an extension toolstrip wants to talk to its tab (for example). |
| 53 struct MessageChannel; | 53 struct MessageChannel; |
| 54 struct MessagePort; | 54 struct MessagePort; |
| 55 | 55 |
| 56 // Javascript function name constants. | 56 // Javascript function name constants. |
| 57 static const char kDispatchOnConnect[]; | 57 static const char kDispatchOnConnect[]; |
| 58 static const char kDispatchOnDisconnect[]; | 58 static const char kDispatchOnDisconnect[]; |
| 59 static const char kDispatchOnMessage[]; |
| 59 | 60 |
| 60 // Allocates a pair of port ids. | 61 // Allocates a pair of port ids. |
| 61 // NOTE: this can be called from any thread. | 62 // NOTE: this can be called from any thread. |
| 62 static void AllocatePortIdPair(int* port1, int* port2); | 63 static void AllocatePortIdPair(int* port1, int* port2); |
| 63 | 64 |
| 64 explicit ExtensionMessageService(Profile* profile); | 65 explicit ExtensionMessageService(Profile* profile); |
| 65 | 66 |
| 66 // Notification that our owning profile is going away. | 67 // Notification that our owning profile is going away. |
| 67 void DestroyingProfile(); | 68 void DestroyingProfile(); |
| 68 | 69 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 Profile* profile_; | 145 Profile* profile_; |
| 145 | 146 |
| 146 NotificationRegistrar registrar_; | 147 NotificationRegistrar registrar_; |
| 147 | 148 |
| 148 MessageChannelMap channels_; | 149 MessageChannelMap channels_; |
| 149 | 150 |
| 150 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); | 151 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); |
| 151 }; | 152 }; |
| 152 | 153 |
| 153 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
| OLD | NEW |