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

Unified Diff: remoting/protocol/ice_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/ice_connection_to_host.cc ('k') | remoting/protocol/ice_transport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ice_transport.h
diff --git a/remoting/protocol/ice_transport.h b/remoting/protocol/ice_transport.h
index fc72b29d5664e3f46461a2bf2b1e336409747475..60e42114f9619942bd6d927f4029e14929d8a256 100644
--- a/remoting/protocol/ice_transport.h
+++ b/remoting/protocol/ice_transport.h
@@ -27,16 +27,28 @@ class IceTransport : public Transport,
public IceTransportChannel::Delegate,
public DatagramChannelFactory {
public:
+ class EventHandler {
+ public:
+ // Called when transport route changes.
+ virtual void OnIceTransportRouteChange(const std::string& channel_name,
+ const TransportRoute& route) = 0;
+
+ // Called when there is an error connecting the session.
+ virtual void OnIceTransportError(ErrorCode error) = 0;
+ };
+
// |transport_context| must outlive the session.
- explicit IceTransport(scoped_refptr<TransportContext> transport_context);
+ IceTransport(scoped_refptr<TransportContext> transport_context,
+ EventHandler* event_handler);
~IceTransport() override;
+ StreamChannelFactory* GetStreamChannelFactory();
+ StreamChannelFactory* GetMultiplexedChannelFactory();
+
// 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;
private:
typedef std::map<std::string, IceTransportChannel*> ChannelsMap;
@@ -51,15 +63,15 @@ class IceTransport : public Transport,
void AddPendingRemoteTransportInfo(IceTransportChannel* channel);
// IceTransportChannel::Delegate interface.
- void OnTransportIceCredentials(IceTransportChannel* transport,
- const std::string& ufrag,
- const std::string& password) override;
- void OnTransportCandidate(IceTransportChannel* transport,
- const cricket::Candidate& candidate) override;
- void OnTransportRouteChange(IceTransportChannel* transport,
- const TransportRoute& route) override;
- void OnTransportFailed(IceTransportChannel* transport) override;
- void OnTransportDeleted(IceTransportChannel* transport) override;
+ void OnChannelIceCredentials(IceTransportChannel* transport,
+ const std::string& ufrag,
+ const std::string& password) override;
+ void OnChannelCandidate(IceTransportChannel* transport,
+ const cricket::Candidate& candidate) override;
+ void OnChannelRouteChange(IceTransportChannel* transport,
+ const TransportRoute& route) override;
+ void OnChannelFailed(IceTransportChannel* transport) override;
+ void OnChannelDeleted(IceTransportChannel* transport) override;
// Creates empty |pending_transport_info_message_| and schedules timer for
// SentTransportInfo() to sent the message later.
@@ -69,8 +81,9 @@ class IceTransport : public Transport,
void SendTransportInfo();
scoped_refptr<TransportContext> transport_context_;
+ EventHandler* event_handler_;
- Transport::EventHandler* event_handler_ = nullptr;
+ SendTransportInfoCallback send_transport_info_callback_;
ChannelsMap channels_;
scoped_ptr<PseudoTcpChannelFactory> pseudotcp_channel_factory_;
@@ -90,20 +103,6 @@ class IceTransport : public Transport,
DISALLOW_COPY_AND_ASSIGN(IceTransport);
};
-class IceTransportFactory : public TransportFactory {
- public:
- IceTransportFactory(scoped_refptr<TransportContext> transport_context);
- ~IceTransportFactory() override;
-
- // TransportFactory interface.
- scoped_ptr<Transport> CreateTransport() override;
-
- private:
- scoped_refptr<TransportContext> transport_context_;
-
- DISALLOW_COPY_AND_ASSIGN(IceTransportFactory);
-};
-
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/ice_connection_to_host.cc ('k') | remoting/protocol/ice_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698