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

Unified Diff: mojo/system/message_pipe.h

Issue 588193004: Mojo: Have |ProxyMessagePipeEndpoint|s constructed with a |ChannelEndpoint|. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/system/channel_unittest.cc ('k') | mojo/system/message_pipe.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe.h
diff --git a/mojo/system/message_pipe.h b/mojo/system/message_pipe.h
index 07b8923c0bde89c914283709c055048b1336acc6..26f3fa72e1712f28d6d6bad94fec03f4533f5429 100644
--- a/mojo/system/message_pipe.h
+++ b/mojo/system/message_pipe.h
@@ -34,22 +34,23 @@ class Waiter;
class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
: public base::RefCountedThreadSafe<MessagePipe> {
public:
- MessagePipe(scoped_ptr<MessagePipeEndpoint> endpoint0,
- scoped_ptr<MessagePipeEndpoint> endpoint1);
-
// Creates a |MessagePipe| with two new |LocalMessagePipeEndpoint|s.
static MessagePipe* CreateLocalLocal();
// Creates a |MessagePipe| with a |LocalMessagePipeEndpoint| on port 0 and a
- // |ProxyMessagePipeEndpoint| on port 1.
- static MessagePipe* CreateLocalProxy();
+ // |ProxyMessagePipeEndpoint| on port 1. |*channel_endpoint| is set to the
+ // (newly-created) |ChannelEndpoint| for the latter.
+ static MessagePipe* CreateLocalProxy(
+ scoped_refptr<ChannelEndpoint>* channel_endpoint);
// Creates a |MessagePipe| with a |ProxyMessagePipeEndpoint| on port 0 and a
- // |LocalMessagePipeEndpoint| on port 1.
+ // |LocalMessagePipeEndpoint| on port 1. |*channel_endpoint| is set to the
+ // (newly-created) |ChannelEndpoint| for the former.
// Note: This is really only needed in tests (outside of tests, this
// configuration arises from a local message pipe having its port 0
// "converted" using |ConvertLocalToProxy()|).
- static MessagePipe* CreateProxyLocal();
+ static MessagePipe* CreateProxyLocal(
+ scoped_refptr<ChannelEndpoint>* channel_endpoint);
// Gets the other port number (i.e., 0 -> 1, 1 -> 0).
static unsigned GetPeerPort(unsigned port);
@@ -95,11 +96,14 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
scoped_ptr<MessageInTransit> message);
// These are used by |Channel|.
+ // TODO(vtl): Remove |Attach()|.
bool Attach(unsigned port, ChannelEndpoint* channel_endpoint);
void Run(unsigned port);
void OnRemove(unsigned port);
private:
+ MessagePipe();
+
friend class base::RefCountedThreadSafe<MessagePipe>;
virtual ~MessagePipe();
« no previous file with comments | « mojo/system/channel_unittest.cc ('k') | mojo/system/message_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698