| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 the common entry point shared by all Chromoting Host | 5 // This file implements the common entry point shared by all Chromoting Host |
| 6 // processes. | 6 // processes. |
| 7 | 7 |
| 8 #include "remoting/host/host_main.h" | 8 #include "remoting/host/host_main.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 std::string process_type = kProcessTypeHost; | 210 std::string process_type = kProcessTypeHost; |
| 211 if (command_line->HasSwitch(kProcessTypeSwitchName)) { | 211 if (command_line->HasSwitch(kProcessTypeSwitchName)) { |
| 212 process_type = command_line->GetSwitchValueASCII(kProcessTypeSwitchName); | 212 process_type = command_line->GetSwitchValueASCII(kProcessTypeSwitchName); |
| 213 } else { | 213 } else { |
| 214 // Assume that it is the native messaging host starting if "--type" is | 214 // Assume that it is the native messaging host starting if "--type" is |
| 215 // missing and the first argument looks like an origin that represents | 215 // missing and the first argument looks like an origin that represents |
| 216 // an extension. | 216 // an extension. |
| 217 CommandLine::StringVector args = command_line->GetArgs(); | 217 CommandLine::StringVector args = command_line->GetArgs(); |
| 218 if (!args.empty()) { | 218 if (!args.empty()) { |
| 219 #if defined(OS_WIN) | 219 #if defined(OS_WIN) |
| 220 std::string origin = UTF16ToUTF8(args[0]); | 220 std::string origin = base::UTF16ToUTF8(args[0]); |
| 221 #else | 221 #else |
| 222 std::string origin = args[0]; | 222 std::string origin = args[0]; |
| 223 #endif | 223 #endif |
| 224 if (StartsWithASCII(origin, kExtensionOriginPrefix, true)) { | 224 if (StartsWithASCII(origin, kExtensionOriginPrefix, true)) { |
| 225 process_type = kProcessTypeNativeMessagingHost; | 225 process_type = kProcessTypeNativeMessagingHost; |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 MainRoutineFn main_routine = SelectMainRoutine(process_type); | 230 MainRoutineFn main_routine = SelectMainRoutine(process_type); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 242 if (exit_code == kUsageExitCode) { | 242 if (exit_code == kUsageExitCode) { |
| 243 Usage(command_line->GetProgram()); | 243 Usage(command_line->GetProgram()); |
| 244 } | 244 } |
| 245 | 245 |
| 246 remoting::UnloadResources(); | 246 remoting::UnloadResources(); |
| 247 | 247 |
| 248 return exit_code; | 248 return exit_code; |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace remoting | 251 } // namespace remoting |
| OLD | NEW |