| 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 file implements a standalone host process for Me2Me, which is currently | 5 // This file implements a standalone host process for Me2Me, which is currently |
| 6 // used for the Linux-only Virtual Me2Me build. | 6 // used for the Linux-only Virtual Me2Me build. |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
| 23 #include "remoting/base/constants.h" | 23 #include "remoting/base/constants.h" |
| 24 #include "remoting/host/chromoting_host.h" | 24 #include "remoting/host/chromoting_host.h" |
| 25 #include "remoting/host/chromoting_host_context.h" | 25 #include "remoting/host/chromoting_host_context.h" |
| 26 #include "remoting/host/desktop_environment.h" | 26 #include "remoting/host/desktop_environment.h" |
| 27 #include "remoting/host/event_executor.h" | 27 #include "remoting/host/event_executor.h" |
| 28 #include "remoting/host/heartbeat_sender.h" | 28 #include "remoting/host/heartbeat_sender.h" |
| 29 #include "remoting/host/host_config.h" | 29 #include "remoting/host/host_config.h" |
| 30 #include "remoting/host/json_host_config.h" | 30 #include "remoting/host/json_host_config.h" |
| 31 #include "remoting/host/self_access_verifier.h" | |
| 32 | 31 |
| 33 #if defined(TOOLKIT_USES_GTK) | 32 #if defined(TOOLKIT_USES_GTK) |
| 34 #include "ui/gfx/gtk_util.h" | 33 #include "ui/gfx/gtk_util.h" |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 37 namespace { | 36 namespace { |
| 38 // These are used for parsing the config-file locations from the command line, | 37 // These are used for parsing the config-file locations from the command line, |
| 39 // and for defining the default locations if the switches are not present. | 38 // and for defining the default locations if the switches are not present. |
| 40 const char kAuthConfigSwitchName[] = "auth-config"; | 39 const char kAuthConfigSwitchName[] = "auth-config"; |
| 41 const char kHostConfigSwitchName[] = "host-config"; | 40 const char kHostConfigSwitchName[] = "host-config"; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 context.Start(); | 79 context.Start(); |
| 81 | 80 |
| 82 base::Thread file_io_thread("FileIO"); | 81 base::Thread file_io_thread("FileIO"); |
| 83 file_io_thread.Start(); | 82 file_io_thread.Start(); |
| 84 | 83 |
| 85 if (!LoadConfig(file_io_thread.message_loop_proxy())) { | 84 if (!LoadConfig(file_io_thread.message_loop_proxy())) { |
| 86 context.Stop(); | 85 context.Stop(); |
| 87 return 1; | 86 return 1; |
| 88 } | 87 } |
| 89 | 88 |
| 90 // Initialize AccessVerifier. | |
| 91 scoped_ptr<remoting::SelfAccessVerifier> self_access_verifier( | |
| 92 new remoting::SelfAccessVerifier()); | |
| 93 if (!self_access_verifier->Init(host_config_)) { | |
| 94 context.Stop(); | |
| 95 return 1; | |
| 96 } | |
| 97 | |
| 98 // Create the DesktopEnvironment and ChromotingHost. | 89 // Create the DesktopEnvironment and ChromotingHost. |
| 99 scoped_ptr<DesktopEnvironment> desktop_environment( | 90 scoped_ptr<DesktopEnvironment> desktop_environment( |
| 100 DesktopEnvironment::Create(&context)); | 91 DesktopEnvironment::Create(&context)); |
| 101 | 92 |
| 102 host_ = ChromotingHost::Create(&context, host_config_, | 93 host_ = ChromotingHost::Create( |
| 103 desktop_environment.get(), | 94 &context, host_config_, desktop_environment.get(), false); |
| 104 self_access_verifier.release(), false); | |
| 105 | 95 |
| 106 // Initialize HeartbeatSender. | 96 // Initialize HeartbeatSender. |
| 107 scoped_ptr<remoting::HeartbeatSender> heartbeat_sender( | 97 scoped_ptr<remoting::HeartbeatSender> heartbeat_sender( |
| 108 new remoting::HeartbeatSender(context.network_message_loop(), | 98 new remoting::HeartbeatSender(context.network_message_loop(), |
| 109 host_config_)); | 99 host_config_)); |
| 110 if (!heartbeat_sender->Init()) { | 100 if (!heartbeat_sender->Init()) { |
| 111 context.Stop(); | 101 context.Stop(); |
| 112 return 1; | 102 return 1; |
| 113 } | 103 } |
| 114 host_->AddStatusObserver(heartbeat_sender.get()); | 104 host_->AddStatusObserver(heartbeat_sender.get()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Continue windows, though these should not be used for the Me2Me case | 175 // Continue windows, though these should not be used for the Me2Me case |
| 186 // (crbug.com/104377). | 176 // (crbug.com/104377). |
| 187 gfx::GtkInitFromCommandLine(*cmd_line); | 177 gfx::GtkInitFromCommandLine(*cmd_line); |
| 188 #endif // TOOLKIT_USES_GTK | 178 #endif // TOOLKIT_USES_GTK |
| 189 | 179 |
| 190 remoting::HostProcess me2me_host; | 180 remoting::HostProcess me2me_host; |
| 191 me2me_host.InitWithCommandLine(cmd_line); | 181 me2me_host.InitWithCommandLine(cmd_line); |
| 192 | 182 |
| 193 return me2me_host.Run(); | 183 return me2me_host.Run(); |
| 194 } | 184 } |
| OLD | NEW |