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

Unified Diff: mojo/system/channel.h

Issue 484893004: Mojo: Make Core own a PlatformSupport, and plumb it through to Channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/embedder/embedder.cc ('k') | mojo/system/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.h
diff --git a/mojo/system/channel.h b/mojo/system/channel.h
index 61895d6bcfe0e0a85b4759c7fa676f7761a58375..0ad0e1090f602e354aebcc4cd81efdc4e60cf50d 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 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
« no previous file with comments | « mojo/embedder/embedder.cc ('k') | mojo/system/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698