| 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 // TODO(rjkroege): This needs to be different when gpu process split |
| 79 // happens. |
| 80 observer.OnGpuProcessLaunched(); |
| 78 observer.OnGpuThreadReady(); | 81 observer.OnGpuThreadReady(); |
| 82 } |
| 79 } | 83 } |
| 80 | 84 |
| 81 void MusThreadProxy::AddGpuThreadObserver(GpuThreadObserver* observer) { | 85 void MusThreadProxy::AddGpuThreadObserver(GpuThreadObserver* observer) { |
| 82 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 86 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 83 | 87 |
| 84 gpu_thread_observers_.AddObserver(observer); | 88 gpu_thread_observers_.AddObserver(observer); |
| 85 if (IsConnected()) | 89 if (IsConnected()) { |
| 90 // TODO(rjkroege): This needs to be different when gpu process split |
| 91 // happens. |
| 92 observer->OnGpuProcessLaunched(); |
| 86 observer->OnGpuThreadReady(); | 93 observer->OnGpuThreadReady(); |
| 94 } |
| 87 } | 95 } |
| 88 | 96 |
| 89 void MusThreadProxy::RemoveGpuThreadObserver(GpuThreadObserver* observer) { | 97 void MusThreadProxy::RemoveGpuThreadObserver(GpuThreadObserver* observer) { |
| 90 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 98 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 91 gpu_thread_observers_.RemoveObserver(observer); | 99 gpu_thread_observers_.RemoveObserver(observer); |
| 92 } | 100 } |
| 93 | 101 |
| 94 bool MusThreadProxy::IsConnected() { | 102 bool MusThreadProxy::IsConnected() { |
| 95 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 103 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 96 base::AutoLock acquire(lock_); | 104 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); | 358 display_manager_->GpuReceivedHDCPState(display_id, success, state); |
| 351 } | 359 } |
| 352 | 360 |
| 353 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, | 361 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, |
| 354 bool success) const { | 362 bool success) const { |
| 355 DCHECK(on_window_server_thread_.CalledOnValidThread()); | 363 DCHECK(on_window_server_thread_.CalledOnValidThread()); |
| 356 display_manager_->GpuUpdatedHDCPState(display_id, success); | 364 display_manager_->GpuUpdatedHDCPState(display_id, success); |
| 357 } | 365 } |
| 358 | 366 |
| 359 } // namespace ui | 367 } // namespace ui |
| OLD | NEW |