OLD | NEW |
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 Loading... |
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 Loading... |
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__ |
OLD | NEW |