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

Unified Diff: mojo/edk/system/message_pipe_dispatcher.h

Issue 1785843002: [mojo] Implement pipe fusion API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/edk/system/message_pipe_dispatcher.h
diff --git a/mojo/edk/system/message_pipe_dispatcher.h b/mojo/edk/system/message_pipe_dispatcher.h
index 7400515f93036670ec130d3fbf61b20cd31d0fb6..fff6454221d1a4d0c2d1f3af1b5eda3c7f13128c 100644
--- a/mojo/edk/system/message_pipe_dispatcher.h
+++ b/mojo/edk/system/message_pipe_dispatcher.h
@@ -39,6 +39,19 @@ class MessagePipeDispatcher : public Dispatcher {
uint64_t pipe_id,
int endpoint);
+ // Begins a fuse operation for this pipe. Returns |true| if fusing is possible
+ // and |false| otherwise.
+ bool BeginFuse();
+
+ // Cancels a fuse operation for this pipe.
+ void CancelFuse();
+
+ // Fuses this pipe with |other|. |BeginFuse()| must have been called on both
+ // this and |other| first, and |Fuse()| itself must only be called on one of
+ // the two, passing the other as an argument. Both dispatchers are closed as a
+ // result of this operation regardless of whether it succeeds or fails.
+ bool CompleteFuse(MessagePipeDispatcher* other);
yzshen1 2016/03/11 17:17:20 It seems possible to only expose a single Fuse() m
+
// Dispatcher:
Type GetType() const override;
MojoResult Close() override;
@@ -100,6 +113,9 @@ class MessagePipeDispatcher : public Dispatcher {
// Guards access to all the fields below.
mutable base::Lock signal_lock_;
+ // Indicates if a fuse operation has been initiated for this pipe.
+ bool is_fusing_ = false;
+
// This is not the same is |port_transferred_|. It's only held true between
// BeginTransit() and Complete/CancelTransit().
bool in_transit_ = false;

Powered by Google App Engine
This is Rietveld 408576698