| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // TODO(wez): This only needs to be a member because it needs access to the | 216 // TODO(wez): This only needs to be a member because it needs access to the |
| 217 // ChromotingHost, which has to be created after the SupportAccessVerifier. | 217 // ChromotingHost, which has to be created after the SupportAccessVerifier. |
| 218 void SetIT2MeAccessCode(bool successful, const std::string& support_id, | 218 void SetIT2MeAccessCode(bool successful, const std::string& support_id, |
| 219 const base::TimeDelta& lifetime) { | 219 const base::TimeDelta& lifetime) { |
| 220 if (successful) { | 220 if (successful) { |
| 221 std::string host_secret = remoting::GenerateRandomHostSecret(); | 221 std::string host_secret = remoting::GenerateRandomHostSecret(); |
| 222 std::string access_code = support_id + host_secret; | 222 std::string access_code = support_id + host_secret; |
| 223 std::cout << "Support id: " << access_code << std::endl; | 223 std::cout << "Support id: " << access_code << std::endl; |
| 224 | 224 |
| 225 // Tell the ChromotingHost the access code, to use as shared-secret. | 225 // Tell the ChromotingHost the access code, to use as shared-secret. |
| 226 host_->set_access_code(access_code); | 226 host_->SetSharedSecret(access_code); |
| 227 } else { | 227 } else { |
| 228 LOG(ERROR) << "If you haven't done so recently, try running" | 228 LOG(ERROR) << "If you haven't done so recently, try running" |
| 229 << " remoting/tools/register_host.py."; | 229 << " remoting/tools/register_host.py."; |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 FilePath GetConfigPath() { | 233 FilePath GetConfigPath() { |
| 234 if (!config_path_.empty()) | 234 if (!config_path_.empty()) |
| 235 return config_path_; | 235 return config_path_; |
| 236 | 236 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 LOG(ERROR) << "Unknown video codec: " << video_codec; | 298 LOG(ERROR) << "Unknown video codec: " << video_codec; |
| 299 return 1; | 299 return 1; |
| 300 } | 300 } |
| 301 config->mutable_video_configs()->push_back(ChannelConfig( | 301 config->mutable_video_configs()->push_back(ChannelConfig( |
| 302 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 302 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
| 303 simple_host.set_protocol_config(config.release()); | 303 simple_host.set_protocol_config(config.release()); |
| 304 } | 304 } |
| 305 | 305 |
| 306 return simple_host.Run(); | 306 return simple_host.Run(); |
| 307 } | 307 } |
| OLD | NEW |