| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 | 323 |
| 324 void ChromotingHost::set_protocol_config( | 324 void ChromotingHost::set_protocol_config( |
| 325 scoped_ptr<protocol::CandidateSessionConfig> config) { | 325 scoped_ptr<protocol::CandidateSessionConfig> config) { |
| 326 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 326 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
| 327 DCHECK(config.get()); | 327 DCHECK(config.get()); |
| 328 DCHECK_EQ(state_, kInitial); | 328 DCHECK_EQ(state_, kInitial); |
| 329 protocol_config_ = config.Pass(); | 329 protocol_config_ = config.Pass(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void ChromotingHost::OnLocalMouseMoved(const SkIPoint& new_pos) { | |
| 333 if (!network_task_runner_->BelongsToCurrentThread()) { | |
| 334 network_task_runner_->PostTask( | |
| 335 FROM_HERE, base::Bind(&ChromotingHost::OnLocalMouseMoved, | |
| 336 this, new_pos)); | |
| 337 return; | |
| 338 } | |
| 339 | |
| 340 ClientList::iterator client; | |
| 341 for (client = clients_.begin(); client != clients_.end(); ++client) { | |
| 342 (*client)->OnLocalMouseMoved(new_pos); | |
| 343 } | |
| 344 } | |
| 345 | |
| 346 void ChromotingHost::PauseSession(bool pause) { | 332 void ChromotingHost::PauseSession(bool pause) { |
| 347 if (!network_task_runner_->BelongsToCurrentThread()) { | 333 if (!network_task_runner_->BelongsToCurrentThread()) { |
| 348 network_task_runner_->PostTask( | 334 network_task_runner_->PostTask( |
| 349 FROM_HERE, base::Bind(&ChromotingHost::PauseSession, this, pause)); | 335 FROM_HERE, base::Bind(&ChromotingHost::PauseSession, this, pause)); |
| 350 return; | 336 return; |
| 351 } | 337 } |
| 352 | 338 |
| 353 ClientList::iterator client; | 339 ClientList::iterator client; |
| 354 for (client = clients_.begin(); client != clients_.end(); ++client) { | 340 for (client = clients_.begin(); client != clients_.end(); ++client) { |
| 355 (*client)->SetDisableInputs(pause); | 341 (*client)->SetDisableInputs(pause); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); | 381 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); |
| 396 it != shutdown_tasks_.end(); ++it) { | 382 it != shutdown_tasks_.end(); ++it) { |
| 397 it->Run(); | 383 it->Run(); |
| 398 } | 384 } |
| 399 shutdown_tasks_.clear(); | 385 shutdown_tasks_.clear(); |
| 400 | 386 |
| 401 weak_factory_.InvalidateWeakPtrs(); | 387 weak_factory_.InvalidateWeakPtrs(); |
| 402 } | 388 } |
| 403 | 389 |
| 404 } // namespace remoting | 390 } // namespace remoting |
| OLD | NEW |