| 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 #ifndef REMOTING_HOST_CLIENT_CONNECTION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_CONNECTION_H_ |
| 6 #define REMOTING_HOST_CLIENT_CONNECTION_H_ | 6 #define REMOTING_HOST_CLIENT_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Protected constructor used by unit test. | 118 // Protected constructor used by unit test. |
| 119 ClientConnection() {} | 119 ClientConnection() {} |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 // Process a libjingle state change event on the |loop_|. | 122 // Process a libjingle state change event on the |loop_|. |
| 123 void StateChangeTask(JingleChannel::State state); | 123 void StateChangeTask(JingleChannel::State state); |
| 124 | 124 |
| 125 // Process a data buffer received from libjingle. | 125 // Process a data buffer received from libjingle. |
| 126 void PacketReceivedTask(scoped_refptr<media::DataBuffer> data); | 126 void PacketReceivedTask(scoped_refptr<media::DataBuffer> data); |
| 127 | 127 |
| 128 // The libjingle channel used to send and receive data from the remote viewer. | 128 // The libjingle channel used to send and receive data from the remote client. |
| 129 scoped_refptr<JingleChannel> channel_; | 129 scoped_refptr<JingleChannel> channel_; |
| 130 | 130 |
| 131 // The message loop that this object runs on. | 131 // The message loop that this object runs on. |
| 132 MessageLoop* loop_; | 132 MessageLoop* loop_; |
| 133 | 133 |
| 134 // An object used by the ClientConnection to decode data received from the | 134 // An object used by the ClientConnection to decode data received from the |
| 135 // network. | 135 // network. |
| 136 scoped_ptr<ProtocolDecoder> decoder_; | 136 scoped_ptr<ProtocolDecoder> decoder_; |
| 137 | 137 |
| 138 // A queue to count the sizes of the last 10 update streams. | 138 // A queue to count the sizes of the last 10 update streams. |
| 139 std::deque<int> size_queue_; | 139 std::deque<int> size_queue_; |
| 140 | 140 |
| 141 // Count the sum of sizes in the queue. | 141 // Count the sum of sizes in the queue. |
| 142 int size_in_queue_; | 142 int size_in_queue_; |
| 143 | 143 |
| 144 // Measure the number of bytes of the current upstream stream. | 144 // Measure the number of bytes of the current upstream stream. |
| 145 int update_stream_size_; | 145 int update_stream_size_; |
| 146 | 146 |
| 147 // Event handler for handling events sent from this object. | 147 // Event handler for handling events sent from this object. |
| 148 EventHandler* handler_; | 148 EventHandler* handler_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(ClientConnection); | 150 DISALLOW_COPY_AND_ASSIGN(ClientConnection); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace remoting | 153 } // namespace remoting |
| 154 | 154 |
| 155 #endif // REMOTING_HOST_CLIENT_CONNECTION_H_ | 155 #endif // REMOTING_HOST_CLIENT_CONNECTION_H_ |
| OLD | NEW |