| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #include "base/at_exit.h" | 22 #include "base/at_exit.h" |
| 23 #include "base/bind.h" | 23 #include "base/bind.h" |
| 24 #include "base/callback.h" | 24 #include "base/callback.h" |
| 25 #include "base/command_line.h" | 25 #include "base/command_line.h" |
| 26 #include "base/environment.h" | 26 #include "base/environment.h" |
| 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/message_loop.h" | 29 #include "base/message_loop.h" |
| 30 #include "base/path_service.h" | 30 #include "base/path_service.h" |
| 31 #include "base/test/mock_chrome_application_mac.h" | |
| 32 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
| 33 #include "crypto/nss_util.h" | 32 #include "crypto/nss_util.h" |
| 34 #include "remoting/base/constants.h" | 33 #include "remoting/base/constants.h" |
| 35 #include "remoting/host/capturer_fake.h" | 34 #include "remoting/host/capturer_fake.h" |
| 36 #include "remoting/host/chromoting_host.h" | 35 #include "remoting/host/chromoting_host.h" |
| 37 #include "remoting/host/chromoting_host_context.h" | 36 #include "remoting/host/chromoting_host_context.h" |
| 38 #include "remoting/host/desktop_environment.h" | 37 #include "remoting/host/desktop_environment.h" |
| 39 #include "remoting/host/event_executor.h" | 38 #include "remoting/host/event_executor.h" |
| 40 #include "remoting/host/heartbeat_sender.h" | 39 #include "remoting/host/heartbeat_sender.h" |
| 41 #include "remoting/host/host_secret.h" | 40 #include "remoting/host/host_secret.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 bool is_it2me_; | 254 bool is_it2me_; |
| 256 scoped_ptr<CandidateSessionConfig> protocol_config_; | 255 scoped_ptr<CandidateSessionConfig> protocol_config_; |
| 257 | 256 |
| 258 scoped_refptr<ChromotingHost> host_; | 257 scoped_refptr<ChromotingHost> host_; |
| 259 }; | 258 }; |
| 260 | 259 |
| 261 int main(int argc, char** argv) { | 260 int main(int argc, char** argv) { |
| 262 #if defined(OS_MACOSX) | 261 #if defined(OS_MACOSX) |
| 263 // Needed so we don't leak objects when threads are created. | 262 // Needed so we don't leak objects when threads are created. |
| 264 base::mac::ScopedNSAutoreleasePool pool; | 263 base::mac::ScopedNSAutoreleasePool pool; |
| 265 mock_cr_app::RegisterMockCrApp(); | |
| 266 #endif | 264 #endif |
| 267 | 265 |
| 268 CommandLine::Init(argc, argv); | 266 CommandLine::Init(argc, argv); |
| 269 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 267 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 270 | 268 |
| 271 base::AtExitManager exit_manager; | 269 base::AtExitManager exit_manager; |
| 272 crypto::EnsureNSPRInit(); | 270 crypto::EnsureNSPRInit(); |
| 273 | 271 |
| 274 #if defined(TOOLKIT_USES_GTK) | 272 #if defined(TOOLKIT_USES_GTK) |
| 275 gfx::GtkInitFromCommandLine(*cmd_line); | 273 gfx::GtkInitFromCommandLine(*cmd_line); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 305 LOG(ERROR) << "Unknown video codec: " << video_codec; | 303 LOG(ERROR) << "Unknown video codec: " << video_codec; |
| 306 return 1; | 304 return 1; |
| 307 } | 305 } |
| 308 config->mutable_video_configs()->push_back(ChannelConfig( | 306 config->mutable_video_configs()->push_back(ChannelConfig( |
| 309 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 307 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
| 310 simple_host.set_protocol_config(config.release()); | 308 simple_host.set_protocol_config(config.release()); |
| 311 } | 309 } |
| 312 | 310 |
| 313 return simple_host.Run(); | 311 return simple_host.Run(); |
| 314 } | 312 } |
| OLD | NEW |