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

Side by Side Diff: net/udp/udp_socket_win.cc

Issue 211213003: Fix spelling in histogtrams.xml;comment in header; format in cc file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_error_list.h ('k') | tools/metrics/histograms/histograms.xml » ('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/udp/udp_socket_win.h" 5 #include "net/udp/udp_socket_win.h"
6 6
7 #include <mstcpip.h> 7 #include <mstcpip.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 socket_ = CreatePlatformSocket(addr_family_, SOCK_DGRAM, IPPROTO_UDP); 384 socket_ = CreatePlatformSocket(addr_family_, SOCK_DGRAM, IPPROTO_UDP);
385 if (socket_ == INVALID_SOCKET) 385 if (socket_ == INVALID_SOCKET)
386 return MapSystemError(WSAGetLastError()); 386 return MapSystemError(WSAGetLastError());
387 core_ = new Core(this); 387 core_ = new Core(this);
388 return OK; 388 return OK;
389 } 389 }
390 390
391 bool UDPSocketWin::SetReceiveBufferSize(int32 size) { 391 bool UDPSocketWin::SetReceiveBufferSize(int32 size) {
392 DCHECK(CalledOnValidThread()); 392 DCHECK(CalledOnValidThread());
393 setsockopt(socket_, SOL_SOCKET, SO_RCVBUF, 393 setsockopt(socket_, SOL_SOCKET, SO_RCVBUF,
394 reinterpret_cast<const char*>(&size), sizeof(size)); 394 reinterpret_cast<const char*>(&size), sizeof(size));
395 // If the setsockopt fails, but the buffer is big enough, we will return 395 // If the setsockopt fails, but the buffer is big enough, we will return
396 // success. It is not worth testing the return value as we still need to check 396 // success. It is not worth testing the return value as we still need to check
397 // via getsockopt anyway according to Windows documentation. 397 // via getsockopt anyway according to Windows documentation.
398 int32 actual_size = 0; 398 int32 actual_size = 0;
399 int option_size = sizeof(actual_size); 399 int option_size = sizeof(actual_size);
400 int rv = getsockopt(socket_, SOL_SOCKET, SO_RCVBUF, 400 int rv = getsockopt(socket_, SOL_SOCKET, SO_RCVBUF,
401 reinterpret_cast<char*>(&actual_size), &option_size); 401 reinterpret_cast<char*>(&actual_size), &option_size);
402 if (rv != 0) 402 if (rv != 0)
403 return false; 403 return false;
404 if (actual_size < size) { 404 if (actual_size < size) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 // Note: setsockopt(IP_TOS) does not work on windows XP and later. 832 // Note: setsockopt(IP_TOS) does not work on windows XP and later.
833 int UDPSocketWin::SetDiffServCodePoint(DiffServCodePoint dscp) { 833 int UDPSocketWin::SetDiffServCodePoint(DiffServCodePoint dscp) {
834 return ERR_NOT_IMPLEMENTED; 834 return ERR_NOT_IMPLEMENTED;
835 } 835 }
836 836
837 void UDPSocketWin::DetachFromThread() { 837 void UDPSocketWin::DetachFromThread() {
838 base::NonThreadSafe::DetachFromThread(); 838 base::NonThreadSafe::DetachFromThread();
839 } 839 }
840 840
841 } // namespace net 841 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_error_list.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698