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

Unified Diff: remoting/protocol/webrtc_transport.h

Issue 1545743002: Move ownership of Transport out of Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass_client
Patch Set: Created 5 years 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_connection_to_host.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 827d2ef8a53c5b5af03a3176d8769be8fc886d61..a00002939a827b6390c5ff950b6f0451e2d753db 100644
--- a/remoting/protocol/webrtc_transport.h
+++ b/remoting/protocol/webrtc_transport.h
@@ -30,8 +30,18 @@ class TransportContext;
class WebrtcTransport : public Transport,
public webrtc::PeerConnectionObserver {
public:
+ class EventHandler {
+ public:
+ // Called when the transport is connected.
+ virtual void OnWebrtcTransportConnected() = 0;
+
+ // Called when there is an error connecting the session.
+ virtual void OnWebrtcTransportError(ErrorCode error) = 0;
+ };
+
WebrtcTransport(rtc::Thread* worker_thread,
- scoped_refptr<TransportContext> transport_context);
+ scoped_refptr<TransportContext> transport_context,
+ EventHandler* event_handler);
~WebrtcTransport() override;
webrtc::PeerConnectionInterface* peer_connection() {
@@ -41,13 +51,12 @@ class WebrtcTransport : public Transport,
return peer_connection_factory_;
}
+ StreamChannelFactory* GetStreamChannelFactory();
+
// Transport interface.
- void Start(EventHandler* event_handler,
- Authenticator* authenticator) override;
+ void Start(Authenticator* authenticator,
+ SendTransportInfoCallback send_transport_info_callback) override;
bool ProcessTransportInfo(buzz::XmlElement* transport_info) override;
- StreamChannelFactory* GetStreamChannelFactory() override;
- StreamChannelFactory* GetMultiplexedChannelFactory() override;
- WebrtcTransport* AsWebrtcTransport() override;
private:
void OnPortAllocatorCreated(
@@ -84,9 +93,10 @@ class WebrtcTransport : public Transport,
base::ThreadChecker thread_checker_;
+ rtc::Thread* worker_thread_;
scoped_refptr<TransportContext> transport_context_;
EventHandler* event_handler_ = nullptr;
- rtc::Thread* worker_thread_;
+ SendTransportInfoCallback send_transport_info_callback_;
scoped_ptr<webrtc::FakeAudioDeviceModule> fake_audio_device_module_;
@@ -111,22 +121,6 @@ class WebrtcTransport : public Transport,
DISALLOW_COPY_AND_ASSIGN(WebrtcTransport);
};
-class WebrtcTransportFactory : public TransportFactory {
- public:
- WebrtcTransportFactory(rtc::Thread* worker_thread,
- scoped_refptr<TransportContext> transport_context);
- ~WebrtcTransportFactory() override;
-
- // TransportFactory interface.
- scoped_ptr<Transport> CreateTransport() override;
-
- private:
- rtc::Thread* worker_thread_;
- scoped_refptr<TransportContext> transport_context_;
-
- DISALLOW_COPY_AND_ASSIGN(WebrtcTransportFactory);
-};
-
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/webrtc_connection_to_host.cc ('k') | remoting/protocol/webrtc_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698