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

Side by Side Diff: webrtc/base/testutils.h

Issue 1944683002: Read recv timestamps from socket (posix only). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 7 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 | « webrtc/base/testclient.cc ('k') | webrtc/base/virtualsocket_unittest.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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 send_buffer_.resize(new_size); 352 send_buffer_.resize(new_size);
353 } 353 }
354 354
355 void OnConnectEvent(AsyncSocket* socket) { 355 void OnConnectEvent(AsyncSocket* socket) {
356 if (!send_buffer_.empty()) { 356 if (!send_buffer_.empty()) {
357 Flush(); 357 Flush();
358 } 358 }
359 } 359 }
360 void OnReadEvent(AsyncSocket* socket) { 360 void OnReadEvent(AsyncSocket* socket) {
361 char data[64 * 1024]; 361 char data[64 * 1024];
362 int result = socket_->Recv(data, arraysize(data)); 362 int result = socket_->Recv(data, arraysize(data), nullptr);
363 if (result > 0) { 363 if (result > 0) {
364 recv_buffer_.insert(recv_buffer_.end(), data, data + result); 364 recv_buffer_.insert(recv_buffer_.end(), data, data + result);
365 } 365 }
366 } 366 }
367 void OnWriteEvent(AsyncSocket* socket) { 367 void OnWriteEvent(AsyncSocket* socket) {
368 if (!send_buffer_.empty()) { 368 if (!send_buffer_.empty()) {
369 Flush(); 369 Flush();
370 } 370 }
371 } 371 }
372 void OnCloseEvent(AsyncSocket* socket, int error) { 372 void OnCloseEvent(AsyncSocket* socket, int error) {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 << minor_version; 627 << minor_version;
628 LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3)."; 628 LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3).";
629 return false; 629 return false;
630 } 630 }
631 #endif 631 #endif
632 return true; 632 return true;
633 } 633 }
634 } // namespace testing 634 } // namespace testing
635 635
636 #endif // WEBRTC_BASE_TESTUTILS_H__ 636 #endif // WEBRTC_BASE_TESTUTILS_H__
OLDNEW
« no previous file with comments | « webrtc/base/testclient.cc ('k') | webrtc/base/virtualsocket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698