Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: remoting/protocol/chromium_socket_factory.cc

Issue 1866283004: Fix bandwidth estimation on remoting webrtc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | remoting/test/fake_socket_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | remoting/test/fake_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698