| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 NET_EXPORT void GenerateSafeFileName(const std::string& mime_type, | 307 NET_EXPORT void GenerateSafeFileName(const std::string& mime_type, |
| 308 bool ignore_extension, | 308 bool ignore_extension, |
| 309 FilePath* file_path); | 309 FilePath* file_path); |
| 310 | 310 |
| 311 // Checks |port| against a list of ports which are restricted by default. | 311 // Checks |port| against a list of ports which are restricted by default. |
| 312 // Returns true if |port| is allowed, false if it is restricted. | 312 // Returns true if |port| is allowed, false if it is restricted. |
| 313 NET_EXPORT bool IsPortAllowedByDefault(int port); | 313 NET_EXPORT bool IsPortAllowedByDefault(int port); |
| 314 | 314 |
| 315 // Checks |port| against a list of ports which are restricted by the FTP | 315 // Checks |port| against a list of ports which are restricted by the FTP |
| 316 // protocol. Returns true if |port| is allowed, false if it is restricted. | 316 // protocol. Returns true if |port| is allowed, false if it is restricted. |
| 317 bool IsPortAllowedByFtp(int port); | 317 NET_EXPORT_PRIVATE bool IsPortAllowedByFtp(int port); |
| 318 | 318 |
| 319 // Check if banned |port| has been overriden by an entry in | 319 // Check if banned |port| has been overriden by an entry in |
| 320 // |explicitly_allowed_ports_|. | 320 // |explicitly_allowed_ports_|. |
| 321 bool IsPortAllowedByOverride(int port); | 321 NET_EXPORT_PRIVATE bool IsPortAllowedByOverride(int port); |
| 322 | 322 |
| 323 // Set socket to non-blocking mode | 323 // Set socket to non-blocking mode |
| 324 NET_EXPORT int SetNonBlocking(int fd); | 324 NET_EXPORT int SetNonBlocking(int fd); |
| 325 | 325 |
| 326 // Formats the host in |url| and appends it to |output|. The host formatter | 326 // Formats the host in |url| and appends it to |output|. The host formatter |
| 327 // takes the same accept languages component as ElideURL(). | 327 // takes the same accept languages component as ElideURL(). |
| 328 NET_EXPORT void AppendFormattedHost(const GURL& url, | 328 NET_EXPORT void AppendFormattedHost(const GURL& url, |
| 329 const std::string& languages, | 329 const std::string& languages, |
| 330 string16* output); | 330 string16* output); |
| 331 | 331 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 506 |
| 507 // Returns list of network interfaces except loopback interface. If an | 507 // Returns list of network interfaces except loopback interface. If an |
| 508 // interface has more than one address, a separate entry is added to | 508 // interface has more than one address, a separate entry is added to |
| 509 // the list for each address. | 509 // the list for each address. |
| 510 // Can be called only on a thread that allows IO. | 510 // Can be called only on a thread that allows IO. |
| 511 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks); | 511 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks); |
| 512 | 512 |
| 513 } // namespace net | 513 } // namespace net |
| 514 | 514 |
| 515 #endif // NET_BASE_NET_UTIL_H_ | 515 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |