| 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/client_connection.h" | 5 #include "remoting/host/client_connection.h" |
| 6 | 6 |
| 7 #include "google/protobuf/message.h" | 7 #include "google/protobuf/message.h" |
| 8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" |
| 9 #include "remoting/base/protocol_decoder.h" | 9 #include "remoting/base/protocol_decoder.h" |
| 10 #include "remoting/base/protocol_util.h" | 10 #include "remoting/base/protocol_util.h" |
| 11 | 11 |
| 12 using media::DataBuffer; | 12 using media::DataBuffer; |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 // Determine how many update streams we should count to find the size of | 16 // Determine how many update streams we should count to find the size of |
| 17 // average update stream. | 17 // average update stream. |
| 18 static const int kAverageUpdateStream = 10; | 18 static const size_t kAverageUpdateStream = 10; |
| 19 | 19 |
| 20 ClientConnection::ClientConnection(MessageLoop* message_loop, | 20 ClientConnection::ClientConnection(MessageLoop* message_loop, |
| 21 ProtocolDecoder* decoder, | 21 ProtocolDecoder* decoder, |
| 22 EventHandler* handler) | 22 EventHandler* handler) |
| 23 : loop_(message_loop), | 23 : loop_(message_loop), |
| 24 decoder_(decoder), | 24 decoder_(decoder), |
| 25 size_in_queue_(0), | 25 size_in_queue_(0), |
| 26 update_stream_size_(0), | 26 update_stream_size_(0), |
| 27 handler_(handler) { | 27 handler_(handler) { |
| 28 DCHECK(loop_); | 28 DCHECK(loop_); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DCHECK(decoder_.get()); | 164 DCHECK(decoder_.get()); |
| 165 ClientMessageList list; | 165 ClientMessageList list; |
| 166 decoder_->ParseClientMessages(data, &list); | 166 decoder_->ParseClientMessages(data, &list); |
| 167 | 167 |
| 168 // Then submit the messages to the handler. | 168 // Then submit the messages to the handler. |
| 169 DCHECK(handler_); | 169 DCHECK(handler_); |
| 170 handler_->HandleMessages(this, &list); | 170 handler_->HandleMessages(this, &list); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace remoting | 173 } // namespace remoting |
| OLD | NEW |