| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 HostWindowProxy::HostWindowProxy( | 68 HostWindowProxy::HostWindowProxy( |
| 69 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 69 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 70 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 70 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 71 scoped_ptr<HostWindow> host_window) { | 71 scoped_ptr<HostWindow> host_window) { |
| 72 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 72 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 73 | 73 |
| 74 // Detach |host_window| from the calling thread so that |Core| could run it on | 74 // Detach |host_window| from the calling thread so that |Core| could run it on |
| 75 // the |ui_task_runner_| thread. | 75 // the |ui_task_runner_| thread. |
| 76 host_window->DetachFromThread(); | 76 host_window->DetachFromThread(); |
| 77 core_ = new Core(caller_task_runner, ui_task_runner, host_window.Pass()); | 77 core_ = new Core(caller_task_runner, ui_task_runner, std::move(host_window)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 HostWindowProxy::~HostWindowProxy() { | 80 HostWindowProxy::~HostWindowProxy() { |
| 81 DCHECK(CalledOnValidThread()); | 81 DCHECK(CalledOnValidThread()); |
| 82 | 82 |
| 83 core_->Stop(); | 83 core_->Stop(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void HostWindowProxy::Start( | 86 void HostWindowProxy::Start( |
| 87 const base::WeakPtr<ClientSessionControl>& client_session_control) { | 87 const base::WeakPtr<ClientSessionControl>& client_session_control) { |
| 88 DCHECK(CalledOnValidThread()); | 88 DCHECK(CalledOnValidThread()); |
| 89 | 89 |
| 90 core_->Start(client_session_control); | 90 core_->Start(client_session_control); |
| 91 } | 91 } |
| 92 | 92 |
| 93 HostWindowProxy::Core::Core( | 93 HostWindowProxy::Core::Core( |
| 94 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 94 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 95 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 95 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 96 scoped_ptr<HostWindow> host_window) | 96 scoped_ptr<HostWindow> host_window) |
| 97 : caller_task_runner_(caller_task_runner), | 97 : caller_task_runner_(caller_task_runner), |
| 98 ui_task_runner_(ui_task_runner), | 98 ui_task_runner_(ui_task_runner), |
| 99 host_window_(host_window.Pass()), | 99 host_window_(std::move(host_window)), |
| 100 weak_factory_(this) { | 100 weak_factory_(this) { |
| 101 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 101 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void HostWindowProxy::Core::Start( | 104 void HostWindowProxy::Core::Start( |
| 105 const base::WeakPtr<ClientSessionControl>& client_session_control) { | 105 const base::WeakPtr<ClientSessionControl>& client_session_control) { |
| 106 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 106 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 107 DCHECK(!client_session_control_.get()); | 107 DCHECK(!client_session_control_.get()); |
| 108 DCHECK(client_session_control.get()); | 108 DCHECK(client_session_control.get()); |
| 109 | 109 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 if (client_session_control_.get()) | 176 if (client_session_control_.get()) |
| 177 client_session_control_->SetDisableInputs(disable_inputs); | 177 client_session_control_->SetDisableInputs(disable_inputs); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void HostWindowProxy::Core::ResetVideoPipeline() { | 180 void HostWindowProxy::Core::ResetVideoPipeline() { |
| 181 // ResetVideoPipeline is only used by HostExtensionSession implementations. | 181 // ResetVideoPipeline is only used by HostExtensionSession implementations. |
| 182 NOTREACHED(); | 182 NOTREACHED(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace remoting | 185 } // namespace remoting |
| OLD | NEW |