OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/service_manager/public/c/main.h" |
5 #include "base/at_exit.h" | 6 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 7 #include "base/command_line.h" |
7 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
8 #include "base/i18n/icu_util.h" | 9 #include "base/i18n/icu_util.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/process/launch.h" | 12 #include "base/process/launch.h" |
12 #include "services/service_manager/public/c/main.h" | 13 #include "base/task_scheduler/task_scheduler.h" |
13 #include "services/service_manager/public/cpp/standalone_service/standalone_serv
ice.h" | 14 #include "services/service_manager/public/cpp/standalone_service/standalone_serv
ice.h" |
14 #include "services/service_manager/public/cpp/standalone_service/switches.h" | 15 #include "services/service_manager/public/cpp/standalone_service/switches.h" |
15 #include "services/service_manager/public/interfaces/service.mojom.h" | 16 #include "services/service_manager/public/interfaces/service.mojom.h" |
16 #include "services/service_manager/runner/init.h" | 17 #include "services/service_manager/runner/init.h" |
17 | 18 |
18 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
19 #include "base/mac/bundle_locations.h" | 20 #include "base/mac/bundle_locations.h" |
20 #endif | 21 #endif |
21 | 22 |
22 namespace { | 23 namespace { |
(...skipping 23 matching lines...) Expand all Loading... |
46 base::i18n::InitializeICU(); | 47 base::i18n::InitializeICU(); |
47 | 48 |
48 #if !defined(OFFICIAL_BUILD) | 49 #if !defined(OFFICIAL_BUILD) |
49 // Initialize stack dumping before initializing sandbox to make sure symbol | 50 // Initialize stack dumping before initializing sandbox to make sure symbol |
50 // names in all loaded libraries will be cached. | 51 // names in all loaded libraries will be cached. |
51 base::debug::EnableInProcessStackDumping(); | 52 base::debug::EnableInProcessStackDumping(); |
52 #endif | 53 #endif |
53 | 54 |
54 service_manager::WaitForDebuggerIfNecessary(); | 55 service_manager::WaitForDebuggerIfNecessary(); |
55 | 56 |
| 57 base::TaskScheduler::CreateAndStartWithDefaultParams("StandaloneService"); |
| 58 |
56 service_manager::RunStandaloneService(base::Bind(&RunServiceMain)); | 59 service_manager::RunStandaloneService(base::Bind(&RunServiceMain)); |
| 60 |
| 61 base::TaskScheduler::GetInstance()->Shutdown(); |
| 62 |
57 return 0; | 63 return 0; |
58 } | 64 } |
OLD | NEW |