| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/session_manager.h" | 5 #include "remoting/host/session_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 FROM_HERE, | 317 FROM_HERE, |
| 318 NewRunnableMethod(this, &SessionManager::DoSetRate, new_rate)); | 318 NewRunnableMethod(this, &SessionManager::DoSetRate, new_rate)); |
| 319 ScheduleNextRateControl(); | 319 ScheduleNextRateControl(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void SessionManager::DoSendUpdate(ChromotingHostMessage* message, | 322 void SessionManager::DoSendUpdate(ChromotingHostMessage* message, |
| 323 Encoder::EncodingState state) { | 323 Encoder::EncodingState state) { |
| 324 DCHECK_EQ(network_loop_, MessageLoop::current()); | 324 DCHECK_EQ(network_loop_, MessageLoop::current()); |
| 325 | 325 |
| 326 // Create a data buffer in wire format from |message|. | 326 // Create a data buffer in wire format from |message|. |
| 327 // Note that this takes ownership of |message|. |
| 327 scoped_refptr<media::DataBuffer> data = | 328 scoped_refptr<media::DataBuffer> data = |
| 328 ClientConnection::CreateWireFormatDataBuffer(message); | 329 ClientConnection::CreateWireFormatDataBuffer(message); |
| 329 | 330 |
| 330 for (ClientConnectionList::const_iterator i = clients_.begin(); | 331 for (ClientConnectionList::const_iterator i = clients_.begin(); |
| 331 i < clients_.end(); ++i) { | 332 i < clients_.end(); ++i) { |
| 332 // TODO(hclam): Merge BeginUpdateStreamMessage into |message|. | 333 // TODO(hclam): Merge BeginUpdateStreamMessage into |message|. |
| 333 if (state & Encoder::EncodingStarting) { | 334 if (state & Encoder::EncodingStarting) { |
| 334 (*i)->SendBeginUpdateStreamMessage(); | 335 (*i)->SendBeginUpdateStreamMessage(); |
| 335 } | 336 } |
| 336 | 337 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 FROM_HERE, | 405 FROM_HERE, |
| 405 NewRunnableMethod(this, &SessionManager::DoSendUpdate, message, state)); | 406 NewRunnableMethod(this, &SessionManager::DoSendUpdate, message, state)); |
| 406 | 407 |
| 407 if (state & Encoder::EncodingEnded) { | 408 if (state & Encoder::EncodingEnded) { |
| 408 capture_loop_->PostTask( | 409 capture_loop_->PostTask( |
| 409 FROM_HERE, NewRunnableMethod(this, &SessionManager::DoFinishEncode)); | 410 FROM_HERE, NewRunnableMethod(this, &SessionManager::DoFinishEncode)); |
| 410 } | 411 } |
| 411 } | 412 } |
| 412 | 413 |
| 413 } // namespace remoting | 414 } // namespace remoting |
| OLD | NEW |