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

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

Issue 152003: Fix some issues with extension messaging: (Closed)
Patch Set: Created 11 years, 5 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 // --- UI thread only: 134 // --- UI thread only:
135 135
136 // UI-thread specific initialization. Does nothing if called more than once. 136 // UI-thread specific initialization. Does nothing if called more than once.
137 void Init(); 137 void Init();
138 138
139 // Handles channel creation and notifies the destination that a channel was 139 // Handles channel creation and notifies the destination that a channel was
140 // opened. 140 // opened.
141 void OpenChannelOnUIThread(int source_routing_id, 141 void OpenChannelOnUIThread(int source_routing_id,
142 int source_port_id, int source_process_id, 142 int source_port_id, int source_process_id,
143 int dest_port_id, int dest_process_id); 143 int dest_port_id, int dest_process_id,
144 const std::string& extension_id);
144 145
145 // Common between OpenChannelOnUIThread and 146 // Common between OpenChannelOnUIThread and
146 // OpenAutomationChannelToExtension. 147 // OpenAutomationChannelToExtension.
147 void OpenChannelOnUIThreadImpl( 148 void OpenChannelOnUIThreadImpl(
148 int source_routing_id, int source_port_id, IPC::Message::Sender* source, 149 int source_routing_id, int source_port_id, int source_process_id,
149 int dest_port_id, int dest_process_id, int source_process_id); 150 IPC::Message::Sender* source, int dest_port_id, int dest_process_id,
151 const std::string& extension_id);
150 152
151 MessageChannelMap channels_; 153 MessageChannelMap channels_;
152 154
153 // True if Init has been called. 155 // True if Init has been called.
154 bool initialized_; 156 bool initialized_;
155 157
156 // For generating unique channel IDs. 158 // For generating unique channel IDs.
157 int next_port_id_; 159 int next_port_id_;
158 160
159 // Protects the next_port_id_ variable, since it can be 161 // Protects the next_port_id_ variable, since it can be
160 // used on the IO thread or the UI thread. 162 // used on the IO thread or the UI thread.
161 Lock next_port_id_lock_; 163 Lock next_port_id_lock_;
162 164
163 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); 165 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService);
164 }; 166 };
165 167
166 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ 168 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extension_message_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698