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

Unified Diff: remoting/protocol/transport_context.cc

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/transport_context.h ('k') | remoting/protocol/webrtc_connection_to_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/transport_context.cc
diff --git a/remoting/protocol/transport_context.cc b/remoting/protocol/transport_context.cc
index 205df730c20eb751bb116d2c3c2651fcbd25fb9c..8fa25ad4d0391c3e9996423fe2261bdb40a968fb 100644
--- a/remoting/protocol/transport_context.cc
+++ b/remoting/protocol/transport_context.cc
@@ -13,12 +13,31 @@
#include "remoting/protocol/port_allocator_factory.h"
#include "third_party/webrtc/p2p/client/httpportallocator.h"
+#if !defined(OS_NACL)
+#include "jingle/glue/thread_wrapper.h"
+#include "net/url_request/url_request_context_getter.h"
+#include "remoting/protocol/chromium_port_allocator.h"
+#endif // !defined(OS_NACL)
+
namespace remoting {
namespace protocol {
// Get fresh STUN/Relay configuration every hour.
static const int kJingleInfoUpdatePeriodSeconds = 3600;
+#if !defined(OS_NACL)
+// static
+scoped_refptr<TransportContext> TransportContext::ForTests(TransportRole role) {
+ jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
+ return new protocol::TransportContext(
+ nullptr, make_scoped_ptr(
+ new protocol::ChromiumPortAllocatorFactory(nullptr)),
+ protocol::NetworkSettings(
+ protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING),
+ role);
+}
+#endif // !defined(OS_NACL)
+
TransportContext::TransportContext(
SignalStrategy* signal_strategy,
scoped_ptr<PortAllocatorFactory> port_allocator_factory,
« no previous file with comments | « remoting/protocol/transport_context.h ('k') | remoting/protocol/webrtc_connection_to_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698