| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "remoting/host/host_window_proxy.h" | 5 #include "remoting/host/host_window_proxy.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 12 #include "remoting/host/client_session_control.h" | 14 #include "remoting/host/client_session_control.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 14 | 16 |
| 15 namespace remoting { | 17 namespace remoting { |
| 16 | 18 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 70 |
| 69 HostWindowProxy::HostWindowProxy( | 71 HostWindowProxy::HostWindowProxy( |
| 70 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 72 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 71 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 73 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 72 scoped_ptr<HostWindow> host_window) { | 74 scoped_ptr<HostWindow> host_window) { |
| 73 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 75 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 74 | 76 |
| 75 // Detach |host_window| from the calling thread so that |Core| could run it on | 77 // Detach |host_window| from the calling thread so that |Core| could run it on |
| 76 // the |ui_task_runner_| thread. | 78 // the |ui_task_runner_| thread. |
| 77 host_window->DetachFromThread(); | 79 host_window->DetachFromThread(); |
| 78 core_ = new Core(caller_task_runner, ui_task_runner, host_window.Pass()); | 80 core_ = new Core(caller_task_runner, ui_task_runner, std::move(host_window)); |
| 79 } | 81 } |
| 80 | 82 |
| 81 HostWindowProxy::~HostWindowProxy() { | 83 HostWindowProxy::~HostWindowProxy() { |
| 82 DCHECK(CalledOnValidThread()); | 84 DCHECK(CalledOnValidThread()); |
| 83 | 85 |
| 84 core_->Stop(); | 86 core_->Stop(); |
| 85 } | 87 } |
| 86 | 88 |
| 87 void HostWindowProxy::Start( | 89 void HostWindowProxy::Start( |
| 88 const base::WeakPtr<ClientSessionControl>& client_session_control) { | 90 const base::WeakPtr<ClientSessionControl>& client_session_control) { |
| 89 DCHECK(CalledOnValidThread()); | 91 DCHECK(CalledOnValidThread()); |
| 90 | 92 |
| 91 core_->Start(client_session_control); | 93 core_->Start(client_session_control); |
| 92 } | 94 } |
| 93 | 95 |
| 94 HostWindowProxy::Core::Core( | 96 HostWindowProxy::Core::Core( |
| 95 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 97 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 96 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 98 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 97 scoped_ptr<HostWindow> host_window) | 99 scoped_ptr<HostWindow> host_window) |
| 98 : caller_task_runner_(caller_task_runner), | 100 : caller_task_runner_(caller_task_runner), |
| 99 ui_task_runner_(ui_task_runner), | 101 ui_task_runner_(ui_task_runner), |
| 100 host_window_(host_window.Pass()), | 102 host_window_(std::move(host_window)), |
| 101 weak_factory_(this) { | 103 weak_factory_(this) { |
| 102 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 104 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 103 } | 105 } |
| 104 | 106 |
| 105 void HostWindowProxy::Core::Start( | 107 void HostWindowProxy::Core::Start( |
| 106 const base::WeakPtr<ClientSessionControl>& client_session_control) { | 108 const base::WeakPtr<ClientSessionControl>& client_session_control) { |
| 107 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 109 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 108 DCHECK(!client_session_control_.get()); | 110 DCHECK(!client_session_control_.get()); |
| 109 DCHECK(client_session_control.get()); | 111 DCHECK(client_session_control.get()); |
| 110 | 112 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 if (client_session_control_.get()) | 179 if (client_session_control_.get()) |
| 178 client_session_control_->SetDisableInputs(disable_inputs); | 180 client_session_control_->SetDisableInputs(disable_inputs); |
| 179 } | 181 } |
| 180 | 182 |
| 181 void HostWindowProxy::Core::ResetVideoPipeline() { | 183 void HostWindowProxy::Core::ResetVideoPipeline() { |
| 182 // ResetVideoPipeline is only used by HostExtensionSession implementations. | 184 // ResetVideoPipeline is only used by HostExtensionSession implementations. |
| 183 NOTREACHED(); | 185 NOTREACHED(); |
| 184 } | 186 } |
| 185 | 187 |
| 186 } // namespace remoting | 188 } // namespace remoting |
| OLD | NEW |