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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 10538091: [Chromoting] Make ChromotingHost's dependency on libjingle injected, instead of hard-coded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "remoting/host/constants.h" 26 #include "remoting/host/constants.h"
27 #include "remoting/host/capturer.h" 27 #include "remoting/host/capturer.h"
28 #include "remoting/host/chromoting_host.h" 28 #include "remoting/host/chromoting_host.h"
29 #include "remoting/host/chromoting_host_context.h" 29 #include "remoting/host/chromoting_host_context.h"
30 #include "remoting/host/desktop_environment.h" 30 #include "remoting/host/desktop_environment.h"
31 #include "remoting/host/event_executor.h" 31 #include "remoting/host/event_executor.h"
32 #include "remoting/host/heartbeat_sender.h" 32 #include "remoting/host/heartbeat_sender.h"
33 #include "remoting/host/host_config.h" 33 #include "remoting/host/host_config.h"
34 #include "remoting/host/host_event_logger.h" 34 #include "remoting/host/host_event_logger.h"
35 #include "remoting/host/host_user_interface.h" 35 #include "remoting/host/host_user_interface.h"
36 #include "remoting/host/jingle_session_manager_factory.h"
36 #include "remoting/host/json_host_config.h" 37 #include "remoting/host/json_host_config.h"
37 #include "remoting/host/log_to_server.h" 38 #include "remoting/host/log_to_server.h"
38 #include "remoting/host/policy_hack/nat_policy.h" 39 #include "remoting/host/policy_hack/nat_policy.h"
39 #include "remoting/host/signaling_connector.h" 40 #include "remoting/host/signaling_connector.h"
40 #include "remoting/jingle_glue/xmpp_signal_strategy.h" 41 #include "remoting/jingle_glue/xmpp_signal_strategy.h"
41 #include "remoting/protocol/me2me_host_authenticator_factory.h" 42 #include "remoting/protocol/me2me_host_authenticator_factory.h"
42 43
43 #if defined(OS_MACOSX) 44 #if defined(OS_MACOSX)
44 #include "base/mac/scoped_nsautorelease_pool.h" 45 #include "base/mac/scoped_nsautorelease_pool.h"
45 #include "remoting/host/sighup_listener_mac.h" 46 #include "remoting/host/sighup_listener_mac.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 oauth_credentials.Pass(), 365 oauth_credentials.Pass(),
365 context_->url_request_context_getter()); 366 context_->url_request_context_getter());
366 } 367 }
367 } 368 }
368 369
369 if (!desktop_environment_.get()) { 370 if (!desktop_environment_.get()) {
370 desktop_environment_ = 371 desktop_environment_ =
371 DesktopEnvironment::CreateForService(context_.get()); 372 DesktopEnvironment::CreateForService(context_.get());
372 } 373 }
373 374
375 scoped_ptr<SessionManagerFactory> session_manager_factory(
376 new JingleSessionManagerFactory());
377
374 NetworkSettings network_settings( 378 NetworkSettings network_settings(
375 allow_nat_traversal_ ? 379 allow_nat_traversal_ ?
376 NetworkSettings::NAT_TRAVERSAL_ENABLED : 380 NetworkSettings::NAT_TRAVERSAL_ENABLED :
377 NetworkSettings::NAT_TRAVERSAL_DISABLED); 381 NetworkSettings::NAT_TRAVERSAL_DISABLED);
378 if (!allow_nat_traversal_) { 382 if (!allow_nat_traversal_) {
379 network_settings.min_port = kMinPortNumber; 383 network_settings.min_port = kMinPortNumber;
380 network_settings.max_port = kMaxPortNumber; 384 network_settings.max_port = kMaxPortNumber;
381 } 385 }
382 386
383 host_ = new ChromotingHost( 387 host_ = new ChromotingHost(
384 context_.get(), signal_strategy_.get(), desktop_environment_.get(), 388 context_.get(), signal_strategy_.get(), desktop_environment_.get(),
385 network_settings); 389 session_manager_factory.Pass(), network_settings);
Wez 2012/06/11 22:17:06 Pass the new object directly here?
simonmorris 2012/06/11 23:08:59 Done.
386 390
387 heartbeat_sender_.reset(new HeartbeatSender( 391 heartbeat_sender_.reset(new HeartbeatSender(
388 this, host_id_, signal_strategy_.get(), &key_pair_)); 392 this, host_id_, signal_strategy_.get(), &key_pair_));
389 393
390 log_to_server_.reset( 394 log_to_server_.reset(
391 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); 395 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get()));
392 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); 396 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName);
393 397
394 #if defined(OS_MACOSX) || defined(OS_WIN) 398 #if defined(OS_MACOSX) || defined(OS_WIN)
395 host_user_interface_->Start( 399 host_user_interface_->Start(
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 571
568 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. 572 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs.
569 SetProcessDPIAware(); 573 SetProcessDPIAware();
570 574
571 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting 575 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
572 // the command line from GetCommandLineW(), so we can safely pass NULL here. 576 // the command line from GetCommandLineW(), so we can safely pass NULL here.
573 return main(0, NULL); 577 return main(0, NULL);
574 } 578 }
575 579
576 #endif // defined(OS_WIN) 580 #endif // defined(OS_WIN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698