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

Unified Diff: remoting/protocol/ice_transport.h

Issue 1521883006: Add TransportContext class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/fake_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 09f7da6d5454942b5bd08cf64f2cd4808aad07d5..fc72b29d5664e3f46461a2bf2b1e336409747475 100644
--- a/remoting/protocol/ice_transport.h
+++ b/remoting/protocol/ice_transport.h
@@ -27,16 +27,10 @@ class IceTransport : public Transport,
public IceTransportChannel::Delegate,
public DatagramChannelFactory {
public:
- // |port_allocator| must outlive the session.
- IceTransport(cricket::PortAllocator* port_allocator,
- const NetworkSettings& network_settings,
- TransportRole role);
+ // |transport_context| must outlive the session.
+ explicit IceTransport(scoped_refptr<TransportContext> transport_context);
~IceTransport() override;
- // Returns a closure that must be called before transport channels start
- // connecting .
- base::Closure GetCanStartClosure();
-
// Transport interface.
void Start(EventHandler* event_handler,
Authenticator* authenticator) override;
@@ -47,8 +41,6 @@ class IceTransport : public Transport,
private:
typedef std::map<std::string, IceTransportChannel*> ChannelsMap;
- void OnCanStart();
-
// DatagramChannelFactory interface.
void CreateChannel(const std::string& name,
const ChannelCreatedCallback& callback) override;
@@ -76,11 +68,7 @@ class IceTransport : public Transport,
// Sends transport-info message with candidates from |pending_candidates_|.
void SendTransportInfo();
- cricket::PortAllocator* port_allocator_;
- NetworkSettings network_settings_;
- TransportRole role_;
-
- bool can_start_ = false;
+ scoped_refptr<TransportContext> transport_context_;
Transport::EventHandler* event_handler_ = nullptr;
@@ -102,6 +90,20 @@ 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/fake_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