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 "mash/package/mash_packaged_service.h" | 5 #include "mash/package/mash_packaged_service.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/process/process.h" |
10 #include "mash/catalog_viewer/catalog_viewer.h" | 11 #include "mash/catalog_viewer/catalog_viewer.h" |
11 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" | 12 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" |
12 #include "mash/quick_launch/public/interfaces/constants.mojom.h" | 13 #include "mash/quick_launch/public/interfaces/constants.mojom.h" |
13 #include "mash/quick_launch/quick_launch.h" | 14 #include "mash/quick_launch/quick_launch.h" |
14 #include "mash/session/public/interfaces/constants.mojom.h" | 15 #include "mash/session/public/interfaces/constants.mojom.h" |
15 #include "mash/session/session.h" | 16 #include "mash/session/session.h" |
16 #include "mash/task_viewer/public/interfaces/constants.mojom.h" | 17 #include "mash/task_viewer/public/interfaces/constants.mojom.h" |
17 #include "mash/task_viewer/task_viewer.h" | 18 #include "mash/task_viewer/task_viewer.h" |
18 #include "services/service_manager/public/cpp/interface_registry.h" | 19 #include "services/service_manager/public/cpp/interface_registry.h" |
19 #include "services/service_manager/public/cpp/service_context.h" | 20 #include "services/service_manager/public/cpp/service_context.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 NOTREACHED(); | 68 NOTREACHED(); |
68 } | 69 } |
69 | 70 |
70 // Please see header file for details on adding new services. | 71 // Please see header file for details on adding new services. |
71 std::unique_ptr<service_manager::Service> MashPackagedService::CreateService( | 72 std::unique_ptr<service_manager::Service> MashPackagedService::CreateService( |
72 const std::string& name) { | 73 const std::string& name) { |
73 const std::string debugger_target = | 74 const std::string debugger_target = |
74 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 75 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
75 switches::kWaitForDebugger); | 76 switches::kWaitForDebugger); |
76 if (!debugger_target.empty()) { | 77 if (!debugger_target.empty()) { |
77 const size_t index = name.find(':'); | 78 if (name == debugger_target) { |
78 if (index != std::string::npos && | 79 LOG(WARNING) << "waiting for debugger to attach for service " << name |
79 name.substr(index + 1) == debugger_target) { | 80 << " pid=" << base::Process::Current().Pid(); |
80 LOG(WARNING) << "waiting for debugger to attach for service " << name; | |
81 base::debug::WaitForDebugger(120, true); | 81 base::debug::WaitForDebugger(120, true); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 #if defined(OS_CHROMEOS) | 85 #if defined(OS_CHROMEOS) |
86 if (name == "ash") | 86 if (name == "ash") |
87 return base::WrapUnique(new ash::mus::WindowManagerApplication); | 87 return base::WrapUnique(new ash::mus::WindowManagerApplication); |
88 if (name == "accessibility_autoclick") | 88 if (name == "accessibility_autoclick") |
89 return base::WrapUnique(new ash::autoclick::AutoclickApplication); | 89 return base::WrapUnique(new ash::autoclick::AutoclickApplication); |
90 if (name == "touch_hud") | 90 if (name == "touch_hud") |
(...skipping 12 matching lines...) Expand all Loading... |
103 if (name == "test_ime_driver") | 103 if (name == "test_ime_driver") |
104 return base::WrapUnique(new ui::test::TestIMEApplication); | 104 return base::WrapUnique(new ui::test::TestIMEApplication); |
105 #if defined(OS_LINUX) | 105 #if defined(OS_LINUX) |
106 if (name == "font_service") | 106 if (name == "font_service") |
107 return base::WrapUnique(new font_service::FontServiceApp); | 107 return base::WrapUnique(new font_service::FontServiceApp); |
108 #endif | 108 #endif |
109 return nullptr; | 109 return nullptr; |
110 } | 110 } |
111 | 111 |
112 } // namespace mash | 112 } // namespace mash |
OLD | NEW |