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

Unified Diff: mojo/system/message_pipe.h

Issue 505863002: Mojo: Add static factory functions to MessagePipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: mojo/system/message_pipe.h
diff --git a/mojo/system/message_pipe.h b/mojo/system/message_pipe.h
index f39c7b04b334272a074c8dda857e68e67085c828..626d031ceb3517d8e7e815342b42e0913114e417 100644
--- a/mojo/system/message_pipe.h
+++ b/mojo/system/message_pipe.h
@@ -37,9 +37,22 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
MessagePipe(scoped_ptr<MessagePipeEndpoint> endpoint0,
scoped_ptr<MessagePipeEndpoint> endpoint1);
- // Convenience constructor that constructs a |MessagePipe| with two new
- // |LocalMessagePipeEndpoint|s.
- MessagePipe();
+ // Constructs a |MessagePipe| with two new |LocalMessagePipeEndpoint|s.
+ struct LocalLocal {};
+ explicit MessagePipe(LocalLocal);
+
+ // Constructs a |MessagePipe| with a |LocalMessagePipeEndpoint| on port 0 and
+ // a |ProxyMessagePipeEndpoint| on port 1.
+ struct LocalProxy {};
+ explicit MessagePipe(LocalProxy);
+
+ // Constructs a |MessagePipe| with a |ProxyMessagePipeEndpoint| on port 0 and
+ // a |LocalMessagePipeEndpoint| on port 1.
+ // 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()|).
+ struct ProxyLocal {};
+ explicit MessagePipe(ProxyLocal);
// Gets the other port number (i.e., 0 -> 1, 1 -> 0).
static unsigned GetPeerPort(unsigned port);

Powered by Google App Engine
This is Rietveld 408576698