| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "remoting/host/setup/start_host_main.h" | 5 #include "remoting/host/setup/start_host_main.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::CommandLine::ForCurrentProcess(); | 124 base::CommandLine::ForCurrentProcess(); |
| 125 | 125 |
| 126 // This object instance is required by Chrome code (for example, | 126 // This object instance is required by Chrome code (for example, |
| 127 // FilePath, LazyInstance, MessageLoop). | 127 // FilePath, LazyInstance, MessageLoop). |
| 128 base::AtExitManager exit_manager; | 128 base::AtExitManager exit_manager; |
| 129 | 129 |
| 130 logging::LoggingSettings settings; | 130 logging::LoggingSettings settings; |
| 131 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 131 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 132 logging::InitLogging(settings); | 132 logging::InitLogging(settings); |
| 133 | 133 |
| 134 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("RemotingHostSetup"); | 134 base::TaskScheduler::CreateAndStartWithDefaultParams("RemotingHostSetup"); |
| 135 | 135 |
| 136 std::string host_name = command_line->GetSwitchValueASCII("name"); | 136 std::string host_name = command_line->GetSwitchValueASCII("name"); |
| 137 std::string host_pin = command_line->GetSwitchValueASCII("pin"); | 137 std::string host_pin = command_line->GetSwitchValueASCII("pin"); |
| 138 std::string auth_code = command_line->GetSwitchValueASCII("code"); | 138 std::string auth_code = command_line->GetSwitchValueASCII("code"); |
| 139 std::string redirect_url = command_line->GetSwitchValueASCII("redirect-url"); | 139 std::string redirect_url = command_line->GetSwitchValueASCII("redirect-url"); |
| 140 | 140 |
| 141 #if defined(OS_POSIX) | 141 #if defined(OS_POSIX) |
| 142 // Check if current user is root. If it is root, then throw an error message. | 142 // Check if current user is root. If it is root, then throw an error message. |
| 143 // This is because start_host should be run in user mode. | 143 // This is because start_host should be run in user mode. |
| 144 if (geteuid() == 0) { | 144 if (geteuid() == 0) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // IO thread. | 237 // IO thread. |
| 238 host_starter.reset(); | 238 host_starter.reset(); |
| 239 url_request_context_getter = nullptr; | 239 url_request_context_getter = nullptr; |
| 240 | 240 |
| 241 io_thread.Stop(); | 241 io_thread.Stop(); |
| 242 | 242 |
| 243 return g_started ? 0 : 1; | 243 return g_started ? 0 : 1; |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace remoting | 246 } // namespace remoting |
| OLD | NEW |