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

Unified Diff: remoting/protocol/message_pipe.h

Issue 2164163002: Simplify data channel creation logic in WebRTC-based protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 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 | « remoting/protocol/connection_tester.cc ('k') | remoting/protocol/stream_message_pipe_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/message_pipe.h
diff --git a/remoting/protocol/message_pipe.h b/remoting/protocol/message_pipe.h
index 3b4d41c4e2f658ae5ce86f37146e8eca1923c2ff..4d182494a9b58f734876ffc9a83ec45851731137 100644
--- a/remoting/protocol/message_pipe.h
+++ b/remoting/protocol/message_pipe.h
@@ -26,6 +26,9 @@ class MessagePipe {
public:
class EventHandler {
public:
+ // Called when the channel is open.
+ virtual void OnMessagePipeOpen() = 0;
+
// Called when a message is received.
virtual void OnMessageReceived(std::unique_ptr<CompoundBuffer> message) = 0;
@@ -38,8 +41,9 @@ class MessagePipe {
virtual ~MessagePipe() {}
- // Starts the channel. |event_handler| will be called to notify when a message
- // is received or the pipe is closed.
+ // Starts the channel. Must be called immediately after MessagePipe is
+ // created. |event_handler| will be notified when state of the pipe changes or
+ // when a message is received.
virtual void Start(EventHandler* event_handler) = 0;
// Sends a message. |done| is called when the message has been sent to the
« no previous file with comments | « remoting/protocol/connection_tester.cc ('k') | remoting/protocol/stream_message_pipe_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698