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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.h" 5 #include "ui/ozone/platform/drm/host/drm_display_host.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ptr_util.h"
8 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
9 #include "ui/ozone/common/display_snapshot_proxy.h" 10 #include "ui/ozone/common/display_snapshot_proxy.h"
10 #include "ui/ozone/common/display_util.h" 11 #include "ui/ozone/common/display_util.h"
11 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h" 12 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h"
12 13
13 namespace ui { 14 namespace ui {
14 15
15 DrmDisplayHost::DrmDisplayHost(GpuThreadAdapter* sender, 16 DrmDisplayHost::DrmDisplayHost(GpuThreadAdapter* sender,
16 const DisplaySnapshot_Params& params, 17 const DisplaySnapshot_Params& params,
17 bool is_dummy) 18 bool is_dummy)
18 : sender_(sender), 19 : sender_(sender),
19 snapshot_(new DisplaySnapshotProxy(params)), 20 snapshot_(new DisplaySnapshotProxy(params)),
20 is_dummy_(is_dummy) { 21 is_dummy_(is_dummy) {
21 sender_->AddGpuThreadObserver(this); 22 sender_->AddGpuThreadObserver(this);
22 } 23 }
23 24
24 DrmDisplayHost::~DrmDisplayHost() { 25 DrmDisplayHost::~DrmDisplayHost() {
25 sender_->RemoveGpuThreadObserver(this); 26 sender_->RemoveGpuThreadObserver(this);
26 ClearCallbacks(); 27 ClearCallbacks();
27 } 28 }
28 29
29 void DrmDisplayHost::UpdateDisplaySnapshot( 30 void DrmDisplayHost::UpdateDisplaySnapshot(
30 const DisplaySnapshot_Params& params) { 31 const DisplaySnapshot_Params& params) {
31 snapshot_ = make_scoped_ptr(new DisplaySnapshotProxy(params)); 32 snapshot_ = base::WrapUnique(new DisplaySnapshotProxy(params));
32 } 33 }
33 34
34 void DrmDisplayHost::Configure(const DisplayMode* mode, 35 void DrmDisplayHost::Configure(const DisplayMode* mode,
35 const gfx::Point& origin, 36 const gfx::Point& origin,
36 const ConfigureCallback& callback) { 37 const ConfigureCallback& callback) {
37 if (is_dummy_) { 38 if (is_dummy_) {
38 callback.Run(true); 39 callback.Run(true);
39 return; 40 return;
40 } 41 }
41 42
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void DrmDisplayHost::ClearCallbacks() { 123 void DrmDisplayHost::ClearCallbacks() {
123 if (!configure_callback_.is_null()) 124 if (!configure_callback_.is_null())
124 OnDisplayConfigured(false); 125 OnDisplayConfigured(false);
125 if (!get_hdcp_callback_.is_null()) 126 if (!get_hdcp_callback_.is_null())
126 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); 127 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED);
127 if (!set_hdcp_callback_.is_null()) 128 if (!set_hdcp_callback_.is_null())
128 OnHDCPStateUpdated(false); 129 OnHDCPStateUpdated(false);
129 } 130 }
130 131
131 } // namespace ui 132 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_display_host.h ('k') | ui/ozone/platform/drm/host/drm_display_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698