Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: services/ui/service.cc

Issue 2498073003: Fix GPU service and display initialization race. (Closed)
Patch Set: Make function abstract. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/service.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 // Gpu must be running before the PlatformScreen can be initialized. 187 // Gpu must be running before the PlatformScreen can be initialized.
188 window_server_.reset(new ws::WindowServer(this)); 188 window_server_.reset(new ws::WindowServer(this));
189 189
190 // DeviceDataManager must be initialized before TouchController. On non-Linux 190 // DeviceDataManager must be initialized before TouchController. On non-Linux
191 // platforms there is no DeviceDataManager so don't create touch controller. 191 // platforms there is no DeviceDataManager so don't create touch controller.
192 if (ui::DeviceDataManager::HasInstance()) 192 if (ui::DeviceDataManager::HasInstance())
193 touch_controller_.reset( 193 touch_controller_.reset(
194 new ws::TouchController(window_server_->display_manager())); 194 new ws::TouchController(window_server_->display_manager()));
195 195
196 platform_screen_->Init(window_server_->display_manager());
197
198 ime_server_.Init(context()->connector()); 196 ime_server_.Init(context()->connector());
199 } 197 }
200 198
201 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, 199 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
202 service_manager::InterfaceRegistry* registry) { 200 service_manager::InterfaceRegistry* registry) {
203 registry->AddInterface<mojom::AccessibilityManager>(this); 201 registry->AddInterface<mojom::AccessibilityManager>(this);
204 registry->AddInterface<mojom::Clipboard>(this); 202 registry->AddInterface<mojom::Clipboard>(this);
205 registry->AddInterface<mojom::DisplayManager>(this); 203 registry->AddInterface<mojom::DisplayManager>(this);
206 registry->AddInterface<mojom::GpuService>(this); 204 registry->AddInterface<mojom::GpuService>(this);
207 registry->AddInterface<mojom::IMERegistrar>(this); 205 registry->AddInterface<mojom::IMERegistrar>(this);
(...skipping 13 matching lines...) Expand all
221 219
222 platform_screen_->AddInterfaces(registry); 220 platform_screen_->AddInterfaces(registry);
223 221
224 #if defined(USE_OZONE) 222 #if defined(USE_OZONE)
225 ui::OzonePlatform::GetInstance()->AddInterfaces(registry); 223 ui::OzonePlatform::GetInstance()->AddInterfaces(registry);
226 #endif 224 #endif
227 225
228 return true; 226 return true;
229 } 227 }
230 228
229 void Service::StartDisplayInit() {
230 platform_screen_->Init(window_server_->display_manager());
231 }
232
231 void Service::OnFirstDisplayReady() { 233 void Service::OnFirstDisplayReady() {
232 PendingRequests requests; 234 PendingRequests requests;
233 requests.swap(pending_requests_); 235 requests.swap(pending_requests_);
234 for (auto& request : requests) { 236 for (auto& request : requests) {
235 if (request->wtf_request) 237 if (request->wtf_request)
236 Create(request->remote_identity, std::move(*request->wtf_request)); 238 Create(request->remote_identity, std::move(*request->wtf_request));
237 else 239 else
238 Create(request->remote_identity, std::move(*request->dm_request)); 240 Create(request->remote_identity, std::move(*request->dm_request));
239 } 241 }
240 } 242 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 mojom::WindowServerTestRequest request) { 360 mojom::WindowServerTestRequest request) {
359 if (!test_config_) 361 if (!test_config_)
360 return; 362 return;
361 mojo::MakeStrongBinding( 363 mojo::MakeStrongBinding(
362 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), 364 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()),
363 std::move(request)); 365 std::move(request));
364 } 366 }
365 367
366 368
367 } // namespace ui 369 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/service.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698