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

Side by Side Diff: net/socket/socket_test_util.cc

Issue 2253753002: Always use NonBlocking IO for UDP sockets on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 3 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 | « net/socket/socket_test_util.h ('k') | net/socket/udp_client_socket.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 int MockUDPClientSocket::GetPeerAddress(IPEndPoint* address) const { 1388 int MockUDPClientSocket::GetPeerAddress(IPEndPoint* address) const {
1389 *address = peer_addr_; 1389 *address = peer_addr_;
1390 return OK; 1390 return OK;
1391 } 1391 }
1392 1392
1393 int MockUDPClientSocket::GetLocalAddress(IPEndPoint* address) const { 1393 int MockUDPClientSocket::GetLocalAddress(IPEndPoint* address) const {
1394 *address = IPEndPoint(IPAddress(192, 0, 2, 33), source_port_); 1394 *address = IPEndPoint(IPAddress(192, 0, 2, 33), source_port_);
1395 return OK; 1395 return OK;
1396 } 1396 }
1397 1397
1398 void MockUDPClientSocket::UseNonBlockingIO() {}
1399
1400 const NetLogWithSource& MockUDPClientSocket::NetLog() const { 1398 const NetLogWithSource& MockUDPClientSocket::NetLog() const {
1401 return net_log_; 1399 return net_log_;
1402 } 1400 }
1403 1401
1404 int MockUDPClientSocket::Connect(const IPEndPoint& address) { 1402 int MockUDPClientSocket::Connect(const IPEndPoint& address) {
1405 if (!data_) 1403 if (!data_)
1406 return ERR_UNEXPECTED; 1404 return ERR_UNEXPECTED;
1407 connected_ = true; 1405 connected_ = true;
1408 peer_addr_ = address; 1406 peer_addr_ = address;
1409 return data_->connect_data().result; 1407 return data_->connect_data().result;
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 } 1787 }
1790 1788
1791 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { 1789 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) {
1792 int64_t total = 0; 1790 int64_t total = 0;
1793 for (const MockWrite* write = writes; write != writes + writes_size; ++write) 1791 for (const MockWrite* write = writes; write != writes + writes_size; ++write)
1794 total += write->data_len; 1792 total += write->data_len;
1795 return total; 1793 return total;
1796 } 1794 }
1797 1795
1798 } // namespace net 1796 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/udp_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698