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

Unified Diff: remoting/host/remoting_me2me_host.cc

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/host/it2me/it2me_host.cc ('k') | remoting/host/session_manager_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 124c76818cb311c4e35f77c56651b6057df0526c..7e668d43a741eb1ebd3c171689a4442f017c1778 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -63,7 +63,6 @@
#include "remoting/host/oauth_token_getter_impl.h"
#include "remoting/host/pairing_registry_delegate.h"
#include "remoting/host/policy_watcher.h"
-#include "remoting/host/session_manager_factory.h"
#include "remoting/host/shutdown_watchdog.h"
#include "remoting/host/signaling_connector.h"
#include "remoting/host/single_window_desktop_environment.h"
@@ -75,13 +74,15 @@
#include "remoting/host/video_frame_recorder_host_extension.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/channel_authenticator.h"
-#include "remoting/protocol/chromium_port_allocator_factory.h"
+#include "remoting/protocol/chromium_port_allocator.h"
+#include "remoting/protocol/ice_transport.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/me2me_host_authenticator_factory.h"
#include "remoting/protocol/network_settings.h"
#include "remoting/protocol/pairing_registry.h"
#include "remoting/protocol/port_range.h"
#include "remoting/protocol/token_validator.h"
+#include "remoting/protocol/transport_context.h"
#include "remoting/protocol/webrtc_transport.h"
#include "remoting/signaling/push_notification_subscriber.h"
#include "remoting/signaling/xmpp_signal_strategy.h"
@@ -1496,39 +1497,34 @@ void HostProcess::StartHost() {
network_settings.port_range.max_port = NetworkSettings::kDefaultMaxPort;
}
- scoped_ptr<protocol::SessionManager> session_manager;
+ scoped_refptr<protocol::TransportContext> transport_context =
+ new protocol::TransportContext(
+ signal_strategy_.get(),
+ make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory(
+ context_->url_request_context_getter())),
+ network_settings, protocol::TransportRole::SERVER);
+ scoped_ptr<protocol::TransportFactory> transport_factory;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableWebrtc)) {
#if !defined(NDEBUG)
- network_settings.flags = protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING;
-
- scoped_ptr<protocol::PortAllocatorFactory> port_allocator_factory =
- protocol::ChromiumPortAllocatorFactory::Create(
- network_settings, context_->url_request_context_getter());
-
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
// The network thread is also used as worker thread for webrtc.
//
// TODO(sergeyu): Figure out if we would benefit from using a separate
// thread as a worker thread.
- scoped_ptr<protocol::TransportFactory> transport_factory(
- new protocol::WebrtcTransportFactory(
- jingle_glue::JingleThreadWrapper::current(), signal_strategy_.get(),
- std::move(port_allocator_factory),
- protocol::TransportRole::SERVER));
-
- session_manager.reset(
- new protocol::JingleSessionManager(transport_factory.Pass()));
+ transport_factory.reset(new protocol::WebrtcTransportFactory(
+ jingle_glue::JingleThreadWrapper::current(), transport_context));
#else // !defined(NDEBUG)
LOG(ERROR) << "WebRTC is enabled only in debug builds.";
ShutdownHost(kUsageExitCode);
return;
#endif // defined(NDEBUG)
} else {
- session_manager =
- CreateHostSessionManager(signal_strategy_.get(), network_settings,
- context_->url_request_context_getter());
+ transport_factory.reset(
+ new protocol::IceTransportFactory(transport_context));
}
+ scoped_ptr<protocol::SessionManager> session_manager(
+ new protocol::JingleSessionManager(transport_factory.Pass()));
scoped_ptr<protocol::CandidateSessionConfig> protocol_config =
protocol::CandidateSessionConfig::CreateDefault();
« no previous file with comments | « remoting/host/it2me/it2me_host.cc ('k') | remoting/host/session_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698