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

Side by Side Diff: remoting/host/simple_host_process.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 is an application of a minimal host process in a Chromoting 5 // This is an application of a minimal host process in a Chromoting
6 // system. It serves the purpose of gluing different pieces together 6 // system. It serves the purpose of gluing different pieces together
7 // to make a functional host process for testing. 7 // to make a functional host process for testing.
8 // 8 //
9 // It peforms the following functionality: 9 // It peforms the following functionality:
10 // 1. Connect to the GTalk network and register the machine as a host. 10 // 1. Connect to the GTalk network and register the machine as a host.
(...skipping 24 matching lines...) Expand all
35 #include "remoting/host/capturer_fake.h" 35 #include "remoting/host/capturer_fake.h"
36 #include "remoting/host/chromoting_host.h" 36 #include "remoting/host/chromoting_host.h"
37 #include "remoting/host/chromoting_host_context.h" 37 #include "remoting/host/chromoting_host_context.h"
38 #include "remoting/host/constants.h" 38 #include "remoting/host/constants.h"
39 #include "remoting/host/desktop_environment.h" 39 #include "remoting/host/desktop_environment.h"
40 #include "remoting/host/event_executor.h" 40 #include "remoting/host/event_executor.h"
41 #include "remoting/host/heartbeat_sender.h" 41 #include "remoting/host/heartbeat_sender.h"
42 #include "remoting/host/host_key_pair.h" 42 #include "remoting/host/host_key_pair.h"
43 #include "remoting/host/host_secret.h" 43 #include "remoting/host/host_secret.h"
44 #include "remoting/host/it2me_host_user_interface.h" 44 #include "remoting/host/it2me_host_user_interface.h"
45 #include "remoting/host/jingle_session_manager_factory.h"
45 #include "remoting/host/json_host_config.h" 46 #include "remoting/host/json_host_config.h"
46 #include "remoting/host/log_to_server.h" 47 #include "remoting/host/log_to_server.h"
47 #include "remoting/host/register_support_host_request.h" 48 #include "remoting/host/register_support_host_request.h"
48 #include "remoting/host/signaling_connector.h" 49 #include "remoting/host/signaling_connector.h"
49 #include "remoting/jingle_glue/xmpp_signal_strategy.h" 50 #include "remoting/jingle_glue/xmpp_signal_strategy.h"
50 #include "remoting/proto/video.pb.h" 51 #include "remoting/proto/video.pb.h"
51 #include "remoting/protocol/it2me_host_authenticator_factory.h" 52 #include "remoting/protocol/it2me_host_authenticator_factory.h"
52 #include "remoting/protocol/me2me_host_authenticator_factory.h" 53 #include "remoting/protocol/me2me_host_authenticator_factory.h"
53 54
54 #if defined(TOOLKIT_GTK) 55 #if defined(TOOLKIT_GTK)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 scoped_ptr<EventExecutor> event_executor = 226 scoped_ptr<EventExecutor> event_executor =
226 EventExecutor::Create(context_.desktop_message_loop(), 227 EventExecutor::Create(context_.desktop_message_loop(),
227 context_.ui_message_loop(), 228 context_.ui_message_loop(),
228 capturer.get()); 229 capturer.get());
229 desktop_environment_ = DesktopEnvironment::CreateFake( 230 desktop_environment_ = DesktopEnvironment::CreateFake(
230 &context_, capturer.Pass(), event_executor.Pass()); 231 &context_, capturer.Pass(), event_executor.Pass());
231 } else { 232 } else {
232 desktop_environment_ = DesktopEnvironment::Create(&context_); 233 desktop_environment_ = DesktopEnvironment::Create(&context_);
233 } 234 }
234 235
236 scoped_ptr<SessionManagerFactory> session_manager_factory(
237 new JingleSessionManagerFactory());
238
235 host_ = new ChromotingHost(&context_, signal_strategy_.get(), 239 host_ = new ChromotingHost(&context_, signal_strategy_.get(),
236 desktop_environment_.get(), network_settings_); 240 desktop_environment_.get(),
241 session_manager_factory.Pass(),
Wez 2012/06/11 22:17:06 Pass the new object directly here?
simonmorris 2012/06/11 23:08:59 Done.
242 network_settings_);
237 243
238 ServerLogEntry::Mode mode = 244 ServerLogEntry::Mode mode =
239 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; 245 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME;
240 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); 246 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get()));
241 247
242 if (is_it2me_) { 248 if (is_it2me_) {
243 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_)); 249 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_));
244 it2me_host_user_interface_->Start( 250 it2me_host_user_interface_->Start(
245 host_, 251 host_,
246 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure())); 252 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure()));
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 max_port < 0 || max_port > 65535) { 413 max_port < 0 || max_port > 65535) {
408 LOG(ERROR) << "Invalid max-port value: " << max_port 414 LOG(ERROR) << "Invalid max-port value: " << max_port
409 << ". Expected integer in range [0, 65535]."; 415 << ". Expected integer in range [0, 65535].";
410 return 1; 416 return 1;
411 } 417 }
412 simple_host.network_settings()->max_port = max_port; 418 simple_host.network_settings()->max_port = max_port;
413 } 419 }
414 420
415 return simple_host.Run(); 421 return simple_host.Run();
416 } 422 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698