Index: remoting/host/remoting_me2me_host.cc |
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
index 5676f1a75f8b136ed913c6ac6e3a281f4ea01113..837ef4d901cc3251f83d3a793b446b7712c958e0 100644 |
--- a/remoting/host/remoting_me2me_host.cc |
+++ b/remoting/host/remoting_me2me_host.cc |
@@ -5,6 +5,10 @@ |
// This file implements a standalone host process for Me2Me, which is currently |
// used for the Linux-only Virtual Me2Me build. |
+#if defined(OS_WIN) |
+#include <windows.h> |
+#endif |
+ |
#include <string> |
#include "base/at_exit.h" |
@@ -15,6 +19,7 @@ |
#include "base/file_util.h" |
#include "base/logging.h" |
#include "base/message_loop.h" |
+#include "base/path_service.h" |
Jamie
2012/03/01 18:22:32
If this is only needed on Windows, it should proba
alexeypa (please no reviews)
2012/03/01 20:33:58
base/path_service.h is a cross-platfporm header. #
Jamie
2012/03/01 20:59:09
I guess the question is why are we using it in a p
|
#include "base/threading/thread.h" |
#include "build/build_config.h" |
#include "crypto/nss_util.h" |
@@ -78,8 +83,15 @@ class HostProcess { |
} |
void InitWithCommandLine(const CommandLine* cmd_line) { |
- FilePath default_config_dir = |
- file_util::GetHomeDir().Append(kDefaultConfigDir); |
+ FilePath default_config_dir; |
+ |
+#if defined(OS_WIN) |
+ PathService::Get(base::DIR_PROFILE, &default_config_dir); |
+#else |
+ default_config_dir = file_util::GetHomeDir(); |
+#endif |
+ |
+ default_config_dir = default_config_dir.Append(kDefaultConfigDir); |
Wez
2012/03/01 18:03:06
nit: Fold the |default_config_dir| logic into a st
alexeypa (please no reviews)
2012/03/01 20:33:58
Done.
|
if (cmd_line->HasSwitch(kAuthConfigSwitchName)) { |
auth_config_path_ = cmd_line->GetSwitchValuePath(kAuthConfigSwitchName); |
@@ -121,14 +133,14 @@ class HostProcess { |
scoped_refptr<JsonHostConfig> auth_config = |
new JsonHostConfig(auth_config_path_, io_message_loop); |
- std::string failed_path; |
+ FilePath failed_path; |
if (!host_config->Read()) { |
- failed_path = host_config_path_.value(); |
+ failed_path = host_config_path_; |
} else if (!auth_config->Read()) { |
- failed_path = auth_config_path_.value(); |
+ failed_path = auth_config_path_; |
} |
if (!failed_path.empty()) { |
- LOG(ERROR) << "Failed to read configuration file " << failed_path; |
+ LOG(ERROR) << "Failed to read configuration file " << failed_path.value(); |
return false; |
} |
@@ -224,7 +236,7 @@ class HostProcess { |
log_to_server_.reset( |
new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
- host_event_logger_.reset(new HostEventLogger(host_, kApplicationName)); |
+ host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
host_->Start(); |
@@ -312,3 +324,16 @@ int main(int argc, char** argv) { |
return me2me_host.Run(); |
} |
+ |
+#if defined(OS_WIN) |
+ |
+int CALLBACK WinMain(HINSTANCE instance, |
+ HINSTANCE previous_instance, |
+ LPSTR command_line, |
+ int show_command) { |
+ // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
+ // the command line from GetCommandLineW(). |
Wez
2012/03/01 18:03:06
nit: At a first glance, it's not clear whether you
alexeypa (please no reviews)
2012/03/01 20:33:58
Done.
|
+ return main(0, NULL); |
+} |
+ |
+#endif |