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

Side by Side Diff: net/socket/fuzzed_datagram_client_socket.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/fuzzed_datagram_client_socket.h ('k') | net/socket/socket_test_util.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/fuzzed_datagram_client_socket.h" 5 #include "net/socket/fuzzed_datagram_client_socket.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return OK; 79 return OK;
80 } 80 }
81 81
82 int FuzzedDatagramClientSocket::GetLocalAddress(IPEndPoint* address) const { 82 int FuzzedDatagramClientSocket::GetLocalAddress(IPEndPoint* address) const {
83 if (!connected_) 83 if (!connected_)
84 return ERR_SOCKET_NOT_CONNECTED; 84 return ERR_SOCKET_NOT_CONNECTED;
85 *address = IPEndPoint(IPAddress(1, 2, 3, 4), 43210); 85 *address = IPEndPoint(IPAddress(1, 2, 3, 4), 43210);
86 return OK; 86 return OK;
87 } 87 }
88 88
89 void FuzzedDatagramClientSocket::UseNonBlockingIO() {}
90
91 const NetLogWithSource& FuzzedDatagramClientSocket::NetLog() const { 89 const NetLogWithSource& FuzzedDatagramClientSocket::NetLog() const {
92 return net_log_; 90 return net_log_;
93 } 91 }
94 92
95 int FuzzedDatagramClientSocket::Read(IOBuffer* buf, 93 int FuzzedDatagramClientSocket::Read(IOBuffer* buf,
96 int buf_len, 94 int buf_len,
97 const CompletionCallback& callback) { 95 const CompletionCallback& callback) {
98 CHECK(!callback.is_null()); 96 CHECK(!callback.is_null());
99 CHECK_GT(buf_len, 0); 97 CHECK_GT(buf_len, 0);
100 CHECK(!read_pending_); 98 CHECK(!read_pending_);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const net::CompletionCallback& callback, 185 const net::CompletionCallback& callback,
188 int result) { 186 int result) {
189 CHECK(connected_); 187 CHECK(connected_);
190 CHECK(write_pending_); 188 CHECK(write_pending_);
191 189
192 write_pending_ = false; 190 write_pending_ = false;
193 callback.Run(result); 191 callback.Run(result);
194 } 192 }
195 193
196 } // namespace net 194 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/fuzzed_datagram_client_socket.h ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698