| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_BASE_NET_UTIL_H_ | 5 #ifndef NET_BASE_NET_UTIL_H_ |
| 6 #define NET_BASE_NET_UTIL_H_ | 6 #define NET_BASE_NET_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 // Returns whether FormatUrl() would strip a trailing slash from |url|, given a | 315 // Returns whether FormatUrl() would strip a trailing slash from |url|, given a |
| 316 // format flag including kFormatUrlOmitTrailingSlashOnBareHostname. | 316 // format flag including kFormatUrlOmitTrailingSlashOnBareHostname. |
| 317 bool CanStripTrailingSlash(const GURL& url); | 317 bool CanStripTrailingSlash(const GURL& url); |
| 318 | 318 |
| 319 // Strip the portions of |url| that aren't core to the network request. | 319 // Strip the portions of |url| that aren't core to the network request. |
| 320 // - user name / password | 320 // - user name / password |
| 321 // - reference section | 321 // - reference section |
| 322 GURL SimplifyUrlForRequest(const GURL& url); | 322 GURL SimplifyUrlForRequest(const GURL& url); |
| 323 | 323 |
| 324 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); | 324 void SetExplicitlyAllowedPorts(const std::string& allowed_ports); |
| 325 | 325 |
| 326 // Perform a simplistic test to see if IPv6 is supported by trying to create an | 326 // Perform a simplistic test to see if IPv6 is supported by trying to create an |
| 327 // IPv6 socket. | 327 // IPv6 socket. |
| 328 // TODO(jar): Make test more in-depth as needed. | 328 // TODO(jar): Make test more in-depth as needed. |
| 329 bool IPv6Supported(); | 329 bool IPv6Supported(); |
| 330 | 330 |
| 331 // Returns true if it can determine that only loopback addresses are configured. | 331 // Returns true if it can determine that only loopback addresses are configured. |
| 332 // i.e. if only 127.0.0.1 and ::1 are routable. | 332 // i.e. if only 127.0.0.1 and ::1 are routable. |
| 333 bool HaveOnlyLoopbackAddresses(); | 333 bool HaveOnlyLoopbackAddresses(); |
| 334 | 334 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 // Returns the port field of the sockaddr in |info|. | 380 // Returns the port field of the sockaddr in |info|. |
| 381 uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); | 381 uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); |
| 382 | 382 |
| 383 // Returns the value of |info's| port (in host byte ordering). | 383 // Returns the value of |info's| port (in host byte ordering). |
| 384 int GetPortFromAddrinfo(const struct addrinfo* info); | 384 int GetPortFromAddrinfo(const struct addrinfo* info); |
| 385 | 385 |
| 386 } // namespace net | 386 } // namespace net |
| 387 | 387 |
| 388 #endif // NET_BASE_NET_UTIL_H_ | 388 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |