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> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 }; | 68 }; |
69 | 69 |
70 HostWindowProxy::HostWindowProxy( | 70 HostWindowProxy::HostWindowProxy( |
71 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 71 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
72 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 72 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
73 std::unique_ptr<HostWindow> host_window) { | 73 std::unique_ptr<HostWindow> host_window) { |
74 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 74 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
75 | 75 |
76 // Detach |host_window| from the calling thread so that |Core| could run it on | 76 // Detach |host_window| from the calling thread so that |Core| could run it on |
77 // the |ui_task_runner_| thread. | 77 // the |ui_task_runner_| thread. |
78 host_window->DetachFromThread(); | 78 DETACH_FROM_SEQUENCE(host_window->sequence_checker_); |
79 core_ = new Core(caller_task_runner, ui_task_runner, std::move(host_window)); | 79 core_ = new Core(caller_task_runner, ui_task_runner, std::move(host_window)); |
80 } | 80 } |
81 | 81 |
82 HostWindowProxy::~HostWindowProxy() { | 82 HostWindowProxy::~HostWindowProxy() { |
83 DCHECK(CalledOnValidThread()); | 83 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
84 | 84 |
85 core_->Stop(); | 85 core_->Stop(); |
86 } | 86 } |
87 | 87 |
88 void HostWindowProxy::Start( | 88 void HostWindowProxy::Start( |
89 const base::WeakPtr<ClientSessionControl>& client_session_control) { | 89 const base::WeakPtr<ClientSessionControl>& client_session_control) { |
90 DCHECK(CalledOnValidThread()); | 90 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
91 | 91 |
92 core_->Start(client_session_control); | 92 core_->Start(client_session_control); |
93 } | 93 } |
94 | 94 |
95 HostWindowProxy::Core::Core( | 95 HostWindowProxy::Core::Core( |
96 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 96 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
97 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 97 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
98 std::unique_ptr<HostWindow> host_window) | 98 std::unique_ptr<HostWindow> host_window) |
99 : caller_task_runner_(caller_task_runner), | 99 : caller_task_runner_(caller_task_runner), |
100 ui_task_runner_(ui_task_runner), | 100 ui_task_runner_(ui_task_runner), |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 caller_task_runner_->PostTask( | 173 caller_task_runner_->PostTask( |
174 FROM_HERE, base::Bind(&Core::SetDisableInputs, this, disable_inputs)); | 174 FROM_HERE, base::Bind(&Core::SetDisableInputs, this, disable_inputs)); |
175 return; | 175 return; |
176 } | 176 } |
177 | 177 |
178 if (client_session_control_.get()) | 178 if (client_session_control_.get()) |
179 client_session_control_->SetDisableInputs(disable_inputs); | 179 client_session_control_->SetDisableInputs(disable_inputs); |
180 } | 180 } |
181 | 181 |
182 } // namespace remoting | 182 } // namespace remoting |
OLD | NEW |