OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 } // namespace | 88 } // namespace |
89 | 89 |
90 namespace remoting { | 90 namespace remoting { |
91 | 91 |
92 class SimpleHost { | 92 class SimpleHost { |
93 public: | 93 public: |
94 SimpleHost() | 94 SimpleHost() |
95 : message_loop_(MessageLoop::TYPE_UI), | 95 : message_loop_(MessageLoop::TYPE_UI), |
96 file_io_thread_("FileIO"), | 96 file_io_thread_("FileIO"), |
97 context_(message_loop_.message_loop_proxy()), | 97 context_(NULL, message_loop_.message_loop_proxy()), |
98 fake_(false), | 98 fake_(false), |
99 is_it2me_(false) { | 99 is_it2me_(false) { |
100 context_.Start(); | 100 context_.Start(); |
101 file_io_thread_.Start(); | 101 file_io_thread_.Start(); |
102 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 102 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
103 } | 103 } |
104 | 104 |
105 int Run() { | 105 int Run() { |
106 FilePath config_path = GetConfigPath(); | 106 FilePath config_path = GetConfigPath(); |
107 scoped_refptr<JsonHostConfig> config = new JsonHostConfig( | 107 scoped_refptr<JsonHostConfig> config = new JsonHostConfig( |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 max_port < 0 || max_port > 65535) { | 370 max_port < 0 || max_port > 65535) { |
371 LOG(ERROR) << "Invalid max-port value: " << max_port | 371 LOG(ERROR) << "Invalid max-port value: " << max_port |
372 << ". Expected integer in range [0, 65535]."; | 372 << ". Expected integer in range [0, 65535]."; |
373 return 1; | 373 return 1; |
374 } | 374 } |
375 simple_host.network_settings()->max_port = max_port; | 375 simple_host.network_settings()->max_port = max_port; |
376 } | 376 } |
377 | 377 |
378 return simple_host.Run(); | 378 return simple_host.Run(); |
379 } | 379 } |
OLD | NEW |