Chromium Code Reviews| 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 "ui/ozone/platform/drm/mus_thread_proxy.h" | 5 #include "ui/ozone/platform/drm/mus_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/task_runner.h" | 9 #include "base/task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 base::Unretained(this))); | 67 base::Unretained(this))); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void MusThreadProxy::DispatchObserversFromDrmThread() { | 70 void MusThreadProxy::DispatchObserversFromDrmThread() { |
| 71 ws_task_runner_->PostTask(FROM_HERE, base::Bind(&MusThreadProxy::RunObservers, | 71 ws_task_runner_->PostTask(FROM_HERE, base::Bind(&MusThreadProxy::RunObservers, |
| 72 base::Unretained(this))); | 72 base::Unretained(this))); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void MusThreadProxy::RunObservers() { | 75 void MusThreadProxy::RunObservers() { |
| 76 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 76 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 77 for (GpuThreadObserver& observer : gpu_thread_observers_) | 77 for (GpuThreadObserver& observer : gpu_thread_observers_) { |
| 78 observer.OnGpuProcessLaunched(); | |
|
rjkroege
2016/11/22 17:53:32
This will obviously be not quite right when we sup
sadrul
2016/11/22 18:56:55
Added TODO
| |
| 78 observer.OnGpuThreadReady(); | 79 observer.OnGpuThreadReady(); |
| 80 } | |
| 79 } | 81 } |
| 80 | 82 |
| 81 void MusThreadProxy::AddGpuThreadObserver(GpuThreadObserver* observer) { | 83 void MusThreadProxy::AddGpuThreadObserver(GpuThreadObserver* observer) { |
| 82 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 84 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 83 | 85 |
| 84 gpu_thread_observers_.AddObserver(observer); | 86 gpu_thread_observers_.AddObserver(observer); |
| 85 if (IsConnected()) | 87 if (IsConnected()) { |
| 88 observer->OnGpuProcessLaunched(); | |
| 86 observer->OnGpuThreadReady(); | 89 observer->OnGpuThreadReady(); |
| 90 } | |
| 87 } | 91 } |
| 88 | 92 |
| 89 void MusThreadProxy::RemoveGpuThreadObserver(GpuThreadObserver* observer) { | 93 void MusThreadProxy::RemoveGpuThreadObserver(GpuThreadObserver* observer) { |
| 90 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 94 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 91 gpu_thread_observers_.RemoveObserver(observer); | 95 gpu_thread_observers_.RemoveObserver(observer); |
| 92 } | 96 } |
| 93 | 97 |
| 94 bool MusThreadProxy::IsConnected() { | 98 bool MusThreadProxy::IsConnected() { |
| 95 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 99 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 96 base::AutoLock acquire(lock_); | 100 base::AutoLock acquire(lock_); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 display_manager_->GpuReceivedHDCPState(display_id, success, state); | 354 display_manager_->GpuReceivedHDCPState(display_id, success, state); |
| 351 } | 355 } |
| 352 | 356 |
| 353 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, | 357 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, |
| 354 bool success) const { | 358 bool success) const { |
| 355 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 359 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 356 display_manager_->GpuUpdatedHDCPState(display_id, success); | 360 display_manager_->GpuUpdatedHDCPState(display_id, success); |
| 357 } | 361 } |
| 358 | 362 |
| 359 } // namespace ui | 363 } // namespace ui |
| OLD | NEW |