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

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

Issue 10829467: [Chromoting] Introducing refcount-based life time management of the message loops in the service (d… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 3 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
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/win/host_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
25 #include "base/file_path.h" 25 #include "base/file_path.h"
26 #include "base/logging.h" 26 #include "base/logging.h"
27 #include "base/message_loop.h" 27 #include "base/message_loop.h"
28 #include "base/path_service.h" 28 #include "base/path_service.h"
29 #include "base/string_number_conversions.h" 29 #include "base/string_number_conversions.h"
30 #include "base/utf_string_conversions.h" 30 #include "base/utf_string_conversions.h"
31 #include "base/threading/thread.h" 31 #include "base/threading/thread.h"
32 #include "crypto/nss_util.h" 32 #include "crypto/nss_util.h"
33 #include "net/base/network_change_notifier.h" 33 #include "net/base/network_change_notifier.h"
34 #include "net/socket/ssl_server_socket.h" 34 #include "net/socket/ssl_server_socket.h"
35 #include "remoting/base/auto_thread_task_runner.h"
35 #include "remoting/base/constants.h" 36 #include "remoting/base/constants.h"
36 #include "remoting/host/audio_capturer.h" 37 #include "remoting/host/audio_capturer.h"
37 #include "remoting/host/chromoting_host_context.h" 38 #include "remoting/host/chromoting_host_context.h"
38 #include "remoting/host/chromoting_host.h" 39 #include "remoting/host/chromoting_host.h"
39 #include "remoting/host/constants.h" 40 #include "remoting/host/constants.h"
40 #include "remoting/host/desktop_environment.h" 41 #include "remoting/host/desktop_environment.h"
41 #include "remoting/host/dns_blackhole_checker.h" 42 #include "remoting/host/dns_blackhole_checker.h"
42 #include "remoting/host/event_executor.h" 43 #include "remoting/host/event_executor.h"
43 #include "remoting/host/heartbeat_sender.h" 44 #include "remoting/host/heartbeat_sender.h"
44 #include "remoting/host/host_key_pair.h" 45 #include "remoting/host/host_key_pair.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 const char kVideoSwitchValueVp8[] = "vp8"; 91 const char kVideoSwitchValueVp8[] = "vp8";
91 92
92 } // namespace 93 } // namespace
93 94
94 namespace remoting { 95 namespace remoting {
95 96
96 class SimpleHost : public HeartbeatSender::Listener { 97 class SimpleHost : public HeartbeatSender::Listener {
97 public: 98 public:
98 SimpleHost() 99 SimpleHost()
99 : message_loop_(MessageLoop::TYPE_UI), 100 : message_loop_(MessageLoop::TYPE_UI),
100 context_(message_loop_.message_loop_proxy()), 101 context_(new AutoThreadTaskRunner(message_loop_.message_loop_proxy())),
101 fake_(false), 102 fake_(false),
102 is_it2me_(false), 103 is_it2me_(false),
103 shutting_down_(false), 104 shutting_down_(false),
104 exit_code_(kSuccessExitCode) { 105 exit_code_(kSuccessExitCode) {
105 context_.Start(); 106 context_.Start();
106 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); 107 network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
107 } 108 }
108 109
109 // Overridden from HeartbeatSender::Listener 110 // Overridden from HeartbeatSender::Listener
110 virtual void OnUnknownHostIdError() OVERRIDE { 111 virtual void OnUnknownHostIdError() OVERRIDE {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 max_port < 0 || max_port > 65535) { 438 max_port < 0 || max_port > 65535) {
438 LOG(ERROR) << "Invalid max-port value: " << max_port 439 LOG(ERROR) << "Invalid max-port value: " << max_port
439 << ". Expected integer in range [0, 65535]."; 440 << ". Expected integer in range [0, 65535].";
440 return 1; 441 return 1;
441 } 442 }
442 simple_host.network_settings()->max_port = max_port; 443 simple_host.network_settings()->max_port = max_port;
443 } 444 }
444 445
445 return simple_host.Run(); 446 return simple_host.Run();
446 } 447 }
OLDNEW
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/win/host_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698