OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 16 matching lines...) Expand all Loading... |
27 #include "base/file_path.h" | 27 #include "base/file_path.h" |
28 #include "base/logging.h" | 28 #include "base/logging.h" |
29 #include "base/mac/scoped_nsautorelease_pool.h" | 29 #include "base/mac/scoped_nsautorelease_pool.h" |
30 #include "base/message_loop.h" | 30 #include "base/message_loop.h" |
31 #include "base/path_service.h" | 31 #include "base/path_service.h" |
32 #include "base/test/mock_chrome_application_mac.h" | 32 #include "base/test/mock_chrome_application_mac.h" |
33 #include "base/threading/thread.h" | 33 #include "base/threading/thread.h" |
34 #include "crypto/nss_util.h" | 34 #include "crypto/nss_util.h" |
35 #include "media/base/media.h" | 35 #include "media/base/media.h" |
36 #include "remoting/base/constants.h" | 36 #include "remoting/base/constants.h" |
37 #include "remoting/base/logger.h" | |
38 #include "remoting/base/tracer.h" | 37 #include "remoting/base/tracer.h" |
39 #include "remoting/host/capturer_fake.h" | 38 #include "remoting/host/capturer_fake.h" |
40 #include "remoting/host/chromoting_host.h" | 39 #include "remoting/host/chromoting_host.h" |
41 #include "remoting/host/chromoting_host_context.h" | 40 #include "remoting/host/chromoting_host_context.h" |
42 #include "remoting/host/continue_window.h" | 41 #include "remoting/host/continue_window.h" |
43 #include "remoting/host/curtain.h" | 42 #include "remoting/host/curtain.h" |
44 #include "remoting/host/desktop_environment.h" | 43 #include "remoting/host/desktop_environment.h" |
45 #include "remoting/host/disconnect_window.h" | 44 #include "remoting/host/disconnect_window.h" |
46 #include "remoting/host/event_executor.h" | 45 #include "remoting/host/event_executor.h" |
47 #include "remoting/host/heartbeat_sender.h" | 46 #include "remoting/host/heartbeat_sender.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 access_verifier.reset(support_access_verifier.release()); | 169 access_verifier.reset(support_access_verifier.release()); |
171 } else { | 170 } else { |
172 scoped_ptr<remoting::SelfAccessVerifier> self_access_verifier( | 171 scoped_ptr<remoting::SelfAccessVerifier> self_access_verifier( |
173 new remoting::SelfAccessVerifier()); | 172 new remoting::SelfAccessVerifier()); |
174 if (!self_access_verifier->Init(config)) | 173 if (!self_access_verifier->Init(config)) |
175 return 1; | 174 return 1; |
176 access_verifier.reset(self_access_verifier.release()); | 175 access_verifier.reset(self_access_verifier.release()); |
177 } | 176 } |
178 | 177 |
179 // Construct a chromoting host. | 178 // Construct a chromoting host. |
180 logger_.reset(new remoting::Logger()); | |
181 scoped_ptr<DesktopEnvironment> desktop_environment; | 179 scoped_ptr<DesktopEnvironment> desktop_environment; |
182 if (fake_) { | 180 if (fake_) { |
183 remoting::Capturer* capturer = | 181 remoting::Capturer* capturer = |
184 new remoting::CapturerFake(); | 182 new remoting::CapturerFake(); |
185 remoting::EventExecutor* event_executor = | 183 remoting::EventExecutor* event_executor = |
186 remoting::EventExecutor::Create(context.desktop_message_loop(), | 184 remoting::EventExecutor::Create(context.desktop_message_loop(), |
187 capturer); | 185 capturer); |
188 remoting::Curtain* curtain = remoting::Curtain::Create(); | 186 remoting::Curtain* curtain = remoting::Curtain::Create(); |
189 remoting::DisconnectWindow* disconnect_window = | 187 remoting::DisconnectWindow* disconnect_window = |
190 remoting::DisconnectWindow::Create(); | 188 remoting::DisconnectWindow::Create(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 247 |
250 #if defined(OS_WIN) | 248 #if defined(OS_WIN) |
251 wstring home_path = GetEnvironmentVar(kHomeDrive); | 249 wstring home_path = GetEnvironmentVar(kHomeDrive); |
252 home_path += GetEnvironmentVar(kHomePath); | 250 home_path += GetEnvironmentVar(kHomePath); |
253 #else | 251 #else |
254 string home_path = GetEnvironmentVar(base::env_vars::kHome); | 252 string home_path = GetEnvironmentVar(base::env_vars::kHome); |
255 #endif | 253 #endif |
256 return FilePath(home_path).Append(kDefaultConfigPath); | 254 return FilePath(home_path).Append(kDefaultConfigPath); |
257 } | 255 } |
258 | 256 |
259 scoped_ptr<remoting::Logger> logger_; | |
260 | |
261 FilePath config_path_; | 257 FilePath config_path_; |
262 bool fake_; | 258 bool fake_; |
263 bool is_it2me_; | 259 bool is_it2me_; |
264 scoped_ptr<CandidateSessionConfig> protocol_config_; | 260 scoped_ptr<CandidateSessionConfig> protocol_config_; |
265 }; | 261 }; |
266 | 262 |
267 int main(int argc, char** argv) { | 263 int main(int argc, char** argv) { |
268 // Needed for the Mac, so we don't leak objects when threads are created. | 264 // Needed for the Mac, so we don't leak objects when threads are created. |
269 base::mac::ScopedNSAutoreleasePool pool; | 265 base::mac::ScopedNSAutoreleasePool pool; |
270 | 266 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 LOG(ERROR) << "Unknown video codec: " << video_codec; | 313 LOG(ERROR) << "Unknown video codec: " << video_codec; |
318 return 1; | 314 return 1; |
319 } | 315 } |
320 config->mutable_video_configs()->push_back(ChannelConfig( | 316 config->mutable_video_configs()->push_back(ChannelConfig( |
321 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 317 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
322 simple_host.set_protocol_config(config.release()); | 318 simple_host.set_protocol_config(config.release()); |
323 } | 319 } |
324 | 320 |
325 return simple_host.Run(); | 321 return simple_host.Run(); |
326 } | 322 } |
OLD | NEW |