| Index: blimp/engine/app/blimp_engine_config.cc
|
| diff --git a/blimp/engine/app/blimp_engine_config.cc b/blimp/engine/app/blimp_engine_config.cc
|
| index ccbdc4e52ffbd9a6d007b50382dc0945f2a10f53..cfa55eb0637fbad3a6df0f5e4b6ce22d585768ee 100644
|
| --- a/blimp/engine/app/blimp_engine_config.cc
|
| +++ b/blimp/engine/app/blimp_engine_config.cc
|
| @@ -18,16 +18,22 @@ namespace blimp {
|
| namespace engine {
|
|
|
| namespace {
|
| -// Gets the client token from the file provided by the command line. If a read
|
| +// Gets the client token from the command line. Either from the token provided,
|
| +// or from the file provided by the command line. If a file read
|
| // does not succeed, or the switch is malformed, an empty string is returned.
|
| std::string GetClientToken(const base::CommandLine& cmd_line) {
|
| - std::string file_contents;
|
| - const base::FilePath path = cmd_line.GetSwitchValuePath(kClientTokenPath);
|
| - if (!base::ReadFileToString(path, &file_contents)) {
|
| - LOG(ERROR) << "Could not read client token file at "
|
| - << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe());
|
| + std::string token;
|
| + if (cmd_line.HasSwitch(kClientToken)) {
|
| + token = cmd_line.GetSwitchValueASCII(kClientToken);
|
| + } else {
|
| + DCHECK(cmd_line.HasSwitch(kClientTokenPath));
|
| + const base::FilePath path = cmd_line.GetSwitchValuePath(kClientTokenPath);
|
| + if (!base::ReadFileToString(path, &token)) {
|
| + LOG(ERROR) << "Could not read client token file at "
|
| + << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe());
|
| + }
|
| }
|
| - return base::CollapseWhitespaceASCII(file_contents, true);
|
| + return base::CollapseWhitespaceASCII(token, true);
|
| }
|
| } // namespace
|
|
|
|
|