| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/service.h" | 5 #include "services/ui/service.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "components/discardable_memory/service/discardable_shared_memory_manage
r.h" | 16 #include "components/discardable_memory/service/discardable_shared_memory_manage
r.h" |
| 17 #include "mojo/public/cpp/bindings/strong_binding.h" | 17 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 18 #include "services/catalog/public/cpp/resource_loader.h" | 18 #include "services/catalog/public/cpp/resource_loader.h" |
| 19 #include "services/catalog/public/interfaces/constants.mojom.h" | 19 #include "services/catalog/public/interfaces/constants.mojom.h" |
| 20 #include "services/service_manager/public/c/main.h" | 20 #include "services/service_manager/public/c/main.h" |
| 21 #include "services/service_manager/public/cpp/connector.h" | 21 #include "services/service_manager/public/cpp/connector.h" |
| 22 #include "services/service_manager/public/cpp/service_context.h" | 22 #include "services/service_manager/public/cpp/service_context.h" |
| 23 #include "services/tracing/public/cpp/provider.h" | |
| 24 #include "services/ui/clipboard/clipboard_impl.h" | 23 #include "services/ui/clipboard/clipboard_impl.h" |
| 25 #include "services/ui/common/switches.h" | 24 #include "services/ui/common/switches.h" |
| 26 #include "services/ui/display/screen_manager.h" | 25 #include "services/ui/display/screen_manager.h" |
| 27 #include "services/ui/ime/ime_registrar_impl.h" | 26 #include "services/ui/ime/ime_registrar_impl.h" |
| 28 #include "services/ui/ime/ime_server_impl.h" | 27 #include "services/ui/ime/ime_server_impl.h" |
| 29 #include "services/ui/ws/accessibility_manager.h" | 28 #include "services/ui/ws/accessibility_manager.h" |
| 30 #include "services/ui/ws/display_binding.h" | 29 #include "services/ui/ws/display_binding.h" |
| 31 #include "services/ui/ws/display_manager.h" | 30 #include "services/ui/ws/display_manager.h" |
| 32 #include "services/ui/ws/gpu_host.h" | 31 #include "services/ui/ws/gpu_host.h" |
| 33 #include "services/ui/ws/user_activity_monitor.h" | 32 #include "services/ui/ws/user_activity_monitor.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return user_id_to_user_state_[user_id].get(); | 135 return user_id_to_user_state_[user_id].get(); |
| 137 } | 136 } |
| 138 | 137 |
| 139 void Service::AddUserIfNecessary( | 138 void Service::AddUserIfNecessary( |
| 140 const service_manager::Identity& remote_identity) { | 139 const service_manager::Identity& remote_identity) { |
| 141 window_server_->user_id_tracker()->AddUserId(remote_identity.user_id()); | 140 window_server_->user_id_tracker()->AddUserId(remote_identity.user_id()); |
| 142 } | 141 } |
| 143 | 142 |
| 144 void Service::OnStart() { | 143 void Service::OnStart() { |
| 145 base::PlatformThread::SetName("mus"); | 144 base::PlatformThread::SetName("mus"); |
| 146 tracing_.Initialize(context()->connector(), context()->identity().name()); | |
| 147 TRACE_EVENT0("mus", "Service::Initialize started"); | 145 TRACE_EVENT0("mus", "Service::Initialize started"); |
| 148 | 146 |
| 149 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 147 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 150 switches::kUseTestConfig); | 148 switches::kUseTestConfig); |
| 151 #if defined(USE_X11) | 149 #if defined(USE_X11) |
| 152 XInitThreads(); | 150 XInitThreads(); |
| 153 ui::SetDefaultX11ErrorHandlers(); | 151 ui::SetDefaultX11ErrorHandlers(); |
| 154 #endif | 152 #endif |
| 155 | 153 |
| 156 if (test_config_) | 154 if (test_config_) |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 mojom::WindowServerTestRequest request) { | 391 mojom::WindowServerTestRequest request) { |
| 394 if (!test_config_) | 392 if (!test_config_) |
| 395 return; | 393 return; |
| 396 mojo::MakeStrongBinding( | 394 mojo::MakeStrongBinding( |
| 397 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 395 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
| 398 std::move(request)); | 396 std::move(request)); |
| 399 } | 397 } |
| 400 | 398 |
| 401 | 399 |
| 402 } // namespace ui | 400 } // namespace ui |
| OLD | NEW |