| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/protocol/chromium_socket_factory.h" | 5 #include "remoting/protocol/chromium_socket_factory.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 if (send_queue_size_ >= kMaxSendBufferSize) { | 196 if (send_queue_size_ >= kMaxSendBufferSize) { |
| 197 return EWOULDBLOCK; | 197 return EWOULDBLOCK; |
| 198 } | 198 } |
| 199 | 199 |
| 200 PendingPacket packet(data, data_size, endpoint); | 200 PendingPacket packet(data, data_size, endpoint); |
| 201 cricket::ApplyPacketOptions( | 201 cricket::ApplyPacketOptions( |
| 202 reinterpret_cast<uint8_t*>(packet.data->data()), data_size, | 202 reinterpret_cast<uint8_t*>(packet.data->data()), data_size, |
| 203 options.packet_time_params, | 203 options.packet_time_params, |
| 204 (base::TimeTicks::Now() - base::TimeTicks()).InMilliseconds()); | 204 (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds()); |
| 205 send_queue_.push_back(packet); | 205 send_queue_.push_back(packet); |
| 206 send_queue_size_ += data_size; | 206 send_queue_size_ += data_size; |
| 207 | 207 |
| 208 DoSend(); | 208 DoSend(); |
| 209 return data_size; | 209 return data_size; |
| 210 } | 210 } |
| 211 | 211 |
| 212 int UdpPacketSocket::Close() { | 212 int UdpPacketSocket::Close() { |
| 213 state_ = STATE_CLOSED; | 213 state_ = STATE_CLOSED; |
| 214 socket_.reset(); | 214 socket_.reset(); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 return nullptr; | 406 return nullptr; |
| 407 } | 407 } |
| 408 | 408 |
| 409 rtc::AsyncResolverInterface* | 409 rtc::AsyncResolverInterface* |
| 410 ChromiumPacketSocketFactory::CreateAsyncResolver() { | 410 ChromiumPacketSocketFactory::CreateAsyncResolver() { |
| 411 return new rtc::AsyncResolver(); | 411 return new rtc::AsyncResolver(); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace protocol | 414 } // namespace protocol |
| 415 } // namespace remoting | 415 } // namespace remoting |
| OLD | NEW |