| 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 file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 config_watcher_.reset(new base::files::FilePathWatcher()); | 183 config_watcher_.reset(new base::files::FilePathWatcher()); |
| 184 if (!config_watcher_->Watch(host_config_path_, delegate)) { | 184 if (!config_watcher_->Watch(host_config_path_, delegate)) { |
| 185 LOG(ERROR) << "Couldn't watch file " << host_config_path_.value(); | 185 LOG(ERROR) << "Couldn't watch file " << host_config_path_.value(); |
| 186 } | 186 } |
| 187 #endif | 187 #endif |
| 188 } | 188 } |
| 189 | 189 |
| 190 void CreateAuthenticatorFactory() { | 190 void CreateAuthenticatorFactory() { |
| 191 scoped_ptr<protocol::AuthenticatorFactory> factory( | 191 scoped_ptr<protocol::AuthenticatorFactory> factory( |
| 192 new protocol::Me2MeHostAuthenticatorFactory( | 192 new protocol::Me2MeHostAuthenticatorFactory( |
| 193 key_pair_.GenerateCertificate(), | 193 xmpp_login_, key_pair_.GenerateCertificate(), |
| 194 *key_pair_.private_key(), host_secret_hash_)); | 194 *key_pair_.private_key(), host_secret_hash_)); |
| 195 host_->SetAuthenticatorFactory(factory.Pass()); | 195 host_->SetAuthenticatorFactory(factory.Pass()); |
| 196 } | 196 } |
| 197 | 197 |
| 198 int Run() { | 198 int Run() { |
| 199 if (!LoadConfig()) { | 199 if (!LoadConfig()) { |
| 200 return kInvalidHostConfigurationExitCode; | 200 return kInvalidHostConfigurationExitCode; |
| 201 } | 201 } |
| 202 | 202 |
| 203 #if defined(OS_MACOSX) || defined(OS_WIN) | 203 #if defined(OS_MACOSX) || defined(OS_WIN) |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 info.dwSize = sizeof(info); | 566 info.dwSize = sizeof(info); |
| 567 info.dwICC = ICC_STANDARD_CLASSES; | 567 info.dwICC = ICC_STANDARD_CLASSES; |
| 568 InitCommonControlsEx(&info); | 568 InitCommonControlsEx(&info); |
| 569 | 569 |
| 570 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 570 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 571 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 571 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 572 return main(0, NULL); | 572 return main(0, NULL); |
| 573 } | 573 } |
| 574 | 574 |
| 575 #endif // defined(OS_WIN) | 575 #endif // defined(OS_WIN) |
| OLD | NEW |