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

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: Review. 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 26 matching lines...) Expand all
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/json_host_config.h" 45 #include "remoting/host/json_host_config.h"
46 #include "remoting/host/log_to_server.h" 46 #include "remoting/host/log_to_server.h"
47 #include "remoting/host/network_settings.h"
47 #include "remoting/host/register_support_host_request.h" 48 #include "remoting/host/register_support_host_request.h"
49 #include "remoting/host/session_manager_factory.h"
48 #include "remoting/host/signaling_connector.h" 50 #include "remoting/host/signaling_connector.h"
49 #include "remoting/jingle_glue/xmpp_signal_strategy.h" 51 #include "remoting/jingle_glue/xmpp_signal_strategy.h"
50 #include "remoting/proto/video.pb.h" 52 #include "remoting/proto/video.pb.h"
51 #include "remoting/protocol/it2me_host_authenticator_factory.h" 53 #include "remoting/protocol/it2me_host_authenticator_factory.h"
52 #include "remoting/protocol/me2me_host_authenticator_factory.h" 54 #include "remoting/protocol/me2me_host_authenticator_factory.h"
53 55
54 #if defined(TOOLKIT_GTK) 56 #if defined(TOOLKIT_GTK)
55 #include "ui/gfx/gtk_util.h" 57 #include "ui/gfx/gtk_util.h"
56 #elif defined(OS_MACOSX) 58 #elif defined(OS_MACOSX)
57 #include "base/mac/scoped_nsautorelease_pool.h" 59 #include "base/mac/scoped_nsautorelease_pool.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 scoped_ptr<EventExecutor> event_executor = 227 scoped_ptr<EventExecutor> event_executor =
226 EventExecutor::Create(context_.desktop_message_loop(), 228 EventExecutor::Create(context_.desktop_message_loop(),
227 context_.ui_message_loop(), 229 context_.ui_message_loop(),
228 capturer.get()); 230 capturer.get());
229 desktop_environment_ = DesktopEnvironment::CreateFake( 231 desktop_environment_ = DesktopEnvironment::CreateFake(
230 &context_, capturer.Pass(), event_executor.Pass()); 232 &context_, capturer.Pass(), event_executor.Pass());
231 } else { 233 } else {
232 desktop_environment_ = DesktopEnvironment::Create(&context_); 234 desktop_environment_ = DesktopEnvironment::Create(&context_);
233 } 235 }
234 236
235 host_ = new ChromotingHost(&context_, signal_strategy_.get(), 237 host_ = new ChromotingHost(
236 desktop_environment_.get(), network_settings_); 238 &context_, signal_strategy_.get(), desktop_environment_.get(),
239 CreateHostSessionManager(network_settings_,
240 context_.url_request_context_getter()));
237 241
238 ServerLogEntry::Mode mode = 242 ServerLogEntry::Mode mode =
239 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; 243 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME;
240 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); 244 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get()));
241 245
242 if (is_it2me_) { 246 if (is_it2me_) {
243 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_)); 247 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_));
244 it2me_host_user_interface_->Start( 248 it2me_host_user_interface_->Start(
245 host_, 249 host_,
246 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure())); 250 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) { 411 max_port < 0 || max_port > 65535) {
408 LOG(ERROR) << "Invalid max-port value: " << max_port 412 LOG(ERROR) << "Invalid max-port value: " << max_port
409 << ". Expected integer in range [0, 65535]."; 413 << ". Expected integer in range [0, 65535].";
410 return 1; 414 return 1;
411 } 415 }
412 simple_host.network_settings()->max_port = max_port; 416 simple_host.network_settings()->max_port = max_port;
413 } 417 }
414 418
415 return simple_host.Run(); 419 return simple_host.Run();
416 } 420 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698