| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 std::string process_type = kProcessTypeHost; | 195 std::string process_type = kProcessTypeHost; |
| 196 if (command_line->HasSwitch(kProcessTypeSwitchName)) { | 196 if (command_line->HasSwitch(kProcessTypeSwitchName)) { |
| 197 process_type = command_line->GetSwitchValueASCII(kProcessTypeSwitchName); | 197 process_type = command_line->GetSwitchValueASCII(kProcessTypeSwitchName); |
| 198 } | 198 } |
| 199 | 199 |
| 200 MainRoutineFn main_routine = SelectMainRoutine(process_type); | 200 MainRoutineFn main_routine = SelectMainRoutine(process_type); |
| 201 if (!main_routine) { | 201 if (!main_routine) { |
| 202 fprintf(stderr, "Unknown process type '%s' specified.", | 202 fprintf(stderr, "Unknown process type '%s' specified.", |
| 203 process_type.c_str()); | 203 process_type.c_str()); |
| 204 Usage(command_line->GetProgram()); | 204 Usage(command_line->GetProgram()); |
| 205 return kUsageExitCode; | 205 return kInvalidCommandLineExitCode; |
| 206 } | 206 } |
| 207 | 207 |
| 208 // Required to find the ICU data file, used by some file_util routines. | 208 // Required to find the ICU data file, used by some file_util routines. |
| 209 base::i18n::InitializeICU(); | 209 base::i18n::InitializeICU(); |
| 210 | 210 |
| 211 remoting::LoadResources(""); | 211 remoting::LoadResources(""); |
| 212 | 212 |
| 213 // Invoke the entry point. | 213 // Invoke the entry point. |
| 214 int exit_code = main_routine(); | 214 int exit_code = main_routine(); |
| 215 if (exit_code == kUsageExitCode) { | 215 if (exit_code == kInvalidCommandLineExitCode) { |
| 216 Usage(command_line->GetProgram()); | 216 Usage(command_line->GetProgram()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 remoting::UnloadResources(); | 219 remoting::UnloadResources(); |
| 220 | 220 |
| 221 return exit_code; | 221 return exit_code; |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace remoting | 224 } // namespace remoting |
| 225 | 225 |
| 226 #if !defined(OS_WIN) | 226 #if !defined(OS_WIN) |
| 227 int main(int argc, char** argv) { | 227 int main(int argc, char** argv) { |
| 228 return remoting::HostMain(argc, argv); | 228 return remoting::HostMain(argc, argv); |
| 229 } | 229 } |
| 230 #endif // !defined(OS_WIN) | 230 #endif // !defined(OS_WIN) |
| OLD | NEW |