Commit 5d768d84 authored by yuweih's avatar yuweih Committed by Commit bot

[Remoting Linux] Allow native messaging host to specify host config path

This CL allows caller of the me2me NMH to override the path to save the host
config, so that we can have separate host config file when testing NMH against
test gaia environment.

BUG=674685

Review-Url: https://codereview.chromium.org/2581043002
Cr-Commit-Position: refs/heads/master@{#438982}
parent eb1d24d3
...@@ -37,7 +37,15 @@ namespace { ...@@ -37,7 +37,15 @@ namespace {
const char kDaemonScript[] = const char kDaemonScript[] =
"/opt/google/chrome-remote-desktop/chrome-remote-desktop"; "/opt/google/chrome-remote-desktop/chrome-remote-desktop";
// The name of the command-line switch used to specify the host configuration
// file to use.
const char kHostConfigSwitchName[] = "host-config";
base::FilePath GetConfigPath() { base::FilePath GetConfigPath() {
base::CommandLine* current_process = base::CommandLine::ForCurrentProcess();
if (current_process->HasSwitch(kHostConfigSwitchName)) {
return current_process->GetSwitchValuePath(kHostConfigSwitchName);
}
std::string filename = std::string filename =
"host#" + base::MD5String(net::GetHostName()) + ".json"; "host#" + base::MD5String(net::GetHostName()) + ".json";
base::FilePath homedir; base::FilePath homedir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment