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

Side by Side Diff: mojo/edk/system/channel.h

Issue 738453003: Add a ChannelEndpointClient abstraction. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MOJO_EDK_SYSTEM_CHANNEL_H_ 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_H_
6 #define MOJO_EDK_SYSTEM_CHANNEL_H_ 6 #define MOJO_EDK_SYSTEM_CHANNEL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // Note: The IDs generated by this should be checked for existence before use. 194 // Note: The IDs generated by this should be checked for existence before use.
195 LocalChannelEndpointIdGenerator local_id_generator_; 195 LocalChannelEndpointIdGenerator local_id_generator_;
196 196
197 typedef base::hash_map<ChannelEndpointId, scoped_refptr<MessagePipe>> 197 typedef base::hash_map<ChannelEndpointId, scoped_refptr<MessagePipe>>
198 IdToMessagePipeMap; 198 IdToMessagePipeMap;
199 // Map from local IDs to pending/incoming message pipes (i.e., those which do 199 // Map from local IDs to pending/incoming message pipes (i.e., those which do
200 // not yet have a dispatcher attached). 200 // not yet have a dispatcher attached).
201 // TODO(vtl): This is a layering violation, since |Channel| shouldn't know 201 // TODO(vtl): This is a layering violation, since |Channel| shouldn't know
202 // about |MessagePipe|. However, we can't just hang on to |ChannelEndpoint|s 202 // about |MessagePipe|. However, we can't just hang on to |ChannelEndpoint|s
203 // (even if they have a reference to the |MessagePipe|) since their lifetimes 203 // (even if they have a reference to the |MessagePipe|) since their lifetimes
204 // are tied to the "remote" side. When |ChannelEndpoint::OnDisconnect()| 204 // are tied to the "remote" side. When |ChannelEndpoint::OnDisconnect()|
yzshen1 2014/11/18 00:28:17 I think there isn't OnDisconnect anymore
viettrungluu 2014/11/18 00:47:29 Done.
205 // (eventually) results in |ChannelEndpoint::DetachFromMessagePipe()| being 205 // (eventually) results in |ChannelEndpoint::DetachFromClient()| being called.
206 // called. We really need to hang on to the "local" side of the message pipe, 206 // We really need to hang on to the "local" side of the message pipe, to which
207 // to which dispatchers will be "attached". 207 // dispatchers will be "attached".
208 IdToMessagePipeMap incoming_message_pipes_; 208 IdToMessagePipeMap incoming_message_pipes_;
209 // TODO(vtl): We need to keep track of remote IDs (so that we don't collide 209 // TODO(vtl): We need to keep track of remote IDs (so that we don't collide
210 // if/when we wrap). 210 // if/when we wrap).
211 RemoteChannelEndpointIdGenerator remote_id_generator_; 211 RemoteChannelEndpointIdGenerator remote_id_generator_;
212 212
213 DISALLOW_COPY_AND_ASSIGN(Channel); 213 DISALLOW_COPY_AND_ASSIGN(Channel);
214 }; 214 };
215 215
216 } // namespace system 216 } // namespace system
217 } // namespace mojo 217 } // namespace mojo
218 218
219 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_ 219 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698