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

Side by Side Diff: ui/ozone/platform/drm/host/drm_display_host_manager.cc

Issue 2862673002: Use constexpr TaskTraits constructor in ui. (Closed)
Patch Set: Created 3 years, 7 months 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
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 "ui/ozone/platform/drm/host/drm_display_host_manager.h" 5 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <xf86drm.h> 9 #include <xf86drm.h>
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 while (!event_queue_.empty() && !task_pending_) { 241 while (!event_queue_.empty() && !task_pending_) {
242 DisplayEvent event = event_queue_.front(); 242 DisplayEvent event = event_queue_.front();
243 event_queue_.pop(); 243 event_queue_.pop();
244 VLOG(1) << "Got display event " << kDisplayActionString[event.action_type] 244 VLOG(1) << "Got display event " << kDisplayActionString[event.action_type]
245 << " for " << event.path.value(); 245 << " for " << event.path.value();
246 switch (event.action_type) { 246 switch (event.action_type) {
247 case DeviceEvent::ADD: 247 case DeviceEvent::ADD:
248 if (drm_devices_.find(event.path) == drm_devices_.end()) { 248 if (drm_devices_.find(event.path) == drm_devices_.end()) {
249 base::PostTaskWithTraits( 249 base::PostTaskWithTraits(
250 FROM_HERE, 250 FROM_HERE,
251 base::TaskTraits() 251 {base::MayBlock(),
252 .WithShutdownBehavior( 252 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
253 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
254 .MayBlock(),
255 base::Bind(&OpenDeviceAsync, event.path, 253 base::Bind(&OpenDeviceAsync, event.path,
256 base::ThreadTaskRunnerHandle::Get(), 254 base::ThreadTaskRunnerHandle::Get(),
257 base::Bind(&DrmDisplayHostManager::OnAddGraphicsDevice, 255 base::Bind(&DrmDisplayHostManager::OnAddGraphicsDevice,
258 weak_ptr_factory_.GetWeakPtr()))); 256 weak_ptr_factory_.GetWeakPtr())));
259 task_pending_ = true; 257 task_pending_ = true;
260 } 258 }
261 break; 259 break;
262 case DeviceEvent::CHANGE: 260 case DeviceEvent::CHANGE:
263 task_pending_ = base::ThreadTaskRunnerHandle::Get()->PostTask( 261 task_pending_ = base::ThreadTaskRunnerHandle::Get()->PostTask(
264 FROM_HERE, 262 FROM_HERE,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 464
467 callback.Run(snapshots); 465 callback.Run(snapshots);
468 } 466 }
469 467
470 void DrmDisplayHostManager::NotifyDisplayDelegate() const { 468 void DrmDisplayHostManager::NotifyDisplayDelegate() const {
471 if (delegate_) 469 if (delegate_)
472 delegate_->OnConfigurationChanged(); 470 delegate_->OnConfigurationChanged();
473 } 471 }
474 472
475 } // namespace ui 473 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surfaceless.cc ('k') | ui/ozone/platform/headless/headless_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698