Chromium Code Reviews| Index: mojo/system/channel.h |
| diff --git a/mojo/system/channel.h b/mojo/system/channel.h |
| index 61895d6bcfe0e0a85b4759c7fa676f7761a58375..db98a931160a59a65646d1a6d11af0945c2187a9 100644 |
| --- a/mojo/system/channel.h |
| +++ b/mojo/system/channel.h |
| @@ -23,6 +23,11 @@ |
| #include "mojo/system/system_impl_export.h" |
| namespace mojo { |
| + |
| +namespace embedder { |
| +class PlatformSupport; |
| +} |
| + |
| namespace system { |
| // This class is mostly thread-safe. It must be created on an I/O thread. |
| @@ -55,7 +60,9 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel |
| // The first message pipe endpoint attached will have this as its local ID. |
| static const MessageInTransit::EndpointId kBootstrapEndpointId = 1; |
| - Channel(); |
| + // |platform_support| (typically owned by |Core|) must remain alive |Channel| |
|
darin (slow to review)
2014/08/18 23:42:58
nit: errant "|Channel|" in this comment?
viettrungluu
2014/08/19 00:02:32
Done.
|
| + // until after |Shutdown()| is called. |
| + explicit Channel(embedder::PlatformSupport* platform_support); |
| // This must be called on the creation thread before any other methods are |
| // called, and before references to this object are given to any other |
| @@ -120,6 +127,10 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel |
| // See |RawChannel::GetSerializedPlatformHandleSize()|. |
| size_t GetSerializedPlatformHandleSize() const; |
| + embedder::PlatformSupport* platform_support() const { |
| + return platform_support_; |
| + } |
| + |
| private: |
| struct EndpointInfo { |
| enum State { |
| @@ -180,6 +191,8 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel |
| base::ThreadChecker creation_thread_checker_; |
| + embedder::PlatformSupport* const platform_support_; |
| + |
| // Note: |MessagePipe|s MUST NOT be used under |lock_|. I.e., |lock_| can only |
| // be acquired after |MessagePipe::lock_|, never before. Thus to call into a |
| // |MessagePipe|, a reference should be acquired from |