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

Unified Diff: remoting/protocol/webrtc_transport.h

Issue 2146213002: Add support for dynamic channels in WebrtcTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/webrtc_data_stream_adapter.cc ('k') | remoting/protocol/webrtc_transport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_transport.h
diff --git a/remoting/protocol/webrtc_transport.h b/remoting/protocol/webrtc_transport.h
index e3c3f9bd7b9495fc1288935ad6a0af9a345c9d38..cc384cf767ca8855f053079884cc08fe368e612c 100644
--- a/remoting/protocol/webrtc_transport.h
+++ b/remoting/protocol/webrtc_transport.h
@@ -30,6 +30,7 @@ namespace protocol {
class TransportContext;
class MessageChannelFactory;
+class MessagePipe;
class WebrtcTransport : public Transport,
public webrtc::PeerConnectionObserver {
@@ -50,11 +51,19 @@ class WebrtcTransport : public Transport,
// Called when there is an error connecting the session.
virtual void OnWebrtcTransportError(ErrorCode error) = 0;
+ // Called when a new data channel is created by the peer.
+ virtual void OnWebrtcTransportIncomingDataChannel(
+ const std::string& name,
+ std::unique_ptr<MessagePipe> pipe) = 0;
+
// Called when an incoming media stream is added or removed.
virtual void OnWebrtcTransportMediaStreamAdded(
scoped_refptr<webrtc::MediaStreamInterface> stream) = 0;
virtual void OnWebrtcTransportMediaStreamRemoved(
scoped_refptr<webrtc::MediaStreamInterface> stream) = 0;
+
+ protected:
+ virtual ~EventHandler() {}
};
WebrtcTransport(rtc::Thread* worker_thread,
@@ -72,13 +81,10 @@ class WebrtcTransport : public Transport,
return video_encoder_factory_;
}
- // Factories for outgoing and incoming data channels. Must be used only after
- // the transport is connected.
+ // Factory for outgoing data channels. Must be used only after the transport
+ // is connected.
MessageChannelFactory* outgoing_channel_factory() {
- return &outgoing_data_stream_adapter_;
- }
- MessageChannelFactory* incoming_channel_factory() {
- return &incoming_data_stream_adapter_;
+ return data_stream_adapter_.get();
}
// Transport interface.
@@ -144,8 +150,7 @@ class WebrtcTransport : public Transport,
ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_;
- WebrtcDataStreamAdapter outgoing_data_stream_adapter_;
- WebrtcDataStreamAdapter incoming_data_stream_adapter_;
+ std::unique_ptr<WebrtcDataStreamAdapter> data_stream_adapter_;
base::WeakPtrFactory<WebrtcTransport> weak_factory_;
« no previous file with comments | « remoting/protocol/webrtc_data_stream_adapter.cc ('k') | remoting/protocol/webrtc_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698