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

Side by Side Diff: chrome/browser/extensions/extension_message_service.h

Issue 7888064: Only deliver extension messages to contexts that care. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nail down a bit further. Only poke relevant RenderView in the case of chrome.tabs.connect(). Created 9 years, 3 months 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 | Annotate | Revision Log
OLDNEW
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
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[];
60 59
61 // Allocates a pair of port ids. 60 // Allocates a pair of port ids.
62 // NOTE: this can be called from any thread. 61 // NOTE: this can be called from any thread.
63 static void AllocatePortIdPair(int* port1, int* port2); 62 static void AllocatePortIdPair(int* port1, int* port2);
64 63
65 explicit ExtensionMessageService(Profile* profile); 64 explicit ExtensionMessageService(Profile* profile);
66 65
67 // Notification that our owning profile is going away. 66 // Notification that our owning profile is going away.
68 void DestroyingProfile(); 67 void DestroyingProfile();
69 68
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 Profile* profile_; 144 Profile* profile_;
146 145
147 NotificationRegistrar registrar_; 146 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698