OLD | NEW |
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/socket_options.h" | 5 #include "net/socket/socket_options.h" |
6 | 6 |
| 7 #include <cerrno> |
| 8 |
7 #include "build/build_config.h" | 9 #include "build/build_config.h" |
8 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
9 | 11 |
10 #if defined(OS_POSIX) | 12 #if defined(OS_POSIX) |
11 #include <netinet/in.h> | 13 #include <netinet/in.h> |
12 #include <netinet/tcp.h> | 14 #include <netinet/tcp.h> |
13 #include <sys/socket.h> | 15 #include <sys/socket.h> |
14 #elif defined(OS_WIN) | 16 #elif defined(OS_WIN) |
15 #include <winsock2.h> | 17 #include <winsock2.h> |
16 #endif | 18 #endif |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 int os_error = errno; | 75 int os_error = errno; |
74 #elif defined(OS_WIN) | 76 #elif defined(OS_WIN) |
75 int os_error = WSAGetLastError(); | 77 int os_error = WSAGetLastError(); |
76 #endif | 78 #endif |
77 int net_error = (rv == -1) ? MapSystemError(os_error) : OK; | 79 int net_error = (rv == -1) ? MapSystemError(os_error) : OK; |
78 DCHECK(!rv) << "Could not set socket receive buffer size: " << net_error; | 80 DCHECK(!rv) << "Could not set socket receive buffer size: " << net_error; |
79 return net_error; | 81 return net_error; |
80 } | 82 } |
81 | 83 |
82 } // namespace net | 84 } // namespace net |
OLD | NEW |