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 898623002: Make mojo::system::Core not own the PlatformSupport. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: foo Created 5 years, 10 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
« no previous file with comments | « mojo/edk/embedder/test_embedder.cc ('k') | mojo/edk/system/core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // is called, but other threads may have temporarily "dangling" references). 47 // is called, but other threads may have temporarily "dangling" references).
48 // 48 //
49 // Note the lock order (in order of allowable acquisition): 49 // Note the lock order (in order of allowable acquisition):
50 // |ChannelEndpointClient| (e.g., |MessagePipe|), |ChannelEndpoint|, |Channel|. 50 // |ChannelEndpointClient| (e.g., |MessagePipe|), |ChannelEndpoint|, |Channel|.
51 // Thus |Channel| may not call into |ChannelEndpoint| with |Channel|'s lock 51 // Thus |Channel| may not call into |ChannelEndpoint| with |Channel|'s lock
52 // held. 52 // held.
53 class MOJO_SYSTEM_IMPL_EXPORT Channel 53 class MOJO_SYSTEM_IMPL_EXPORT Channel
54 : public base::RefCountedThreadSafe<Channel>, 54 : public base::RefCountedThreadSafe<Channel>,
55 public RawChannel::Delegate { 55 public RawChannel::Delegate {
56 public: 56 public:
57 // |platform_support| (typically owned by |Core|) must remain alive until 57 // |platform_support| must remain alive until after |Shutdown()| is called.
58 // after |Shutdown()| is called.
59 explicit Channel(embedder::PlatformSupport* platform_support); 58 explicit Channel(embedder::PlatformSupport* platform_support);
60 59
61 // This must be called on the creation thread before any other methods are 60 // This must be called on the creation thread before any other methods are
62 // called, and before references to this object are given to any other 61 // called, and before references to this object are given to any other
63 // threads. |raw_channel| should be uninitialized. 62 // threads. |raw_channel| should be uninitialized.
64 void Init(scoped_ptr<RawChannel> raw_channel); 63 void Init(scoped_ptr<RawChannel> raw_channel);
65 64
66 // Sets the channel manager associated with this channel. This should be set 65 // Sets the channel manager associated with this channel. This should be set
67 // at most once and only called before |WillShutdownSoon()| (and 66 // at most once and only called before |WillShutdownSoon()| (and
68 // |Shutdown()|). (This is called by the channel manager when adding a 67 // |Shutdown()|). (This is called by the channel manager when adding a
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // if/when we wrap). 252 // if/when we wrap).
254 RemoteChannelEndpointIdGenerator remote_id_generator_; 253 RemoteChannelEndpointIdGenerator remote_id_generator_;
255 254
256 DISALLOW_COPY_AND_ASSIGN(Channel); 255 DISALLOW_COPY_AND_ASSIGN(Channel);
257 }; 256 };
258 257
259 } // namespace system 258 } // namespace system
260 } // namespace mojo 259 } // namespace mojo
261 260
262 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_ 261 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_
OLDNEW
« no previous file with comments | « mojo/edk/embedder/test_embedder.cc ('k') | mojo/edk/system/core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698