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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // Checks the given port against a list of ports which are restricted by the | 267 // Checks the given port against a list of ports which are restricted by the |
268 // FTP protocol. Returns true if the port is allowed, false if it is | 268 // FTP protocol. Returns true if the port is allowed, false if it is |
269 // restricted. | 269 // restricted. |
270 bool IsPortAllowedByFtp(int port); | 270 bool IsPortAllowedByFtp(int port); |
271 | 271 |
272 // Check if banned |port| has been overriden by an entry in | 272 // Check if banned |port| has been overriden by an entry in |
273 // |explicitly_allowed_ports_|. | 273 // |explicitly_allowed_ports_|. |
274 bool IsPortAllowedByOverride(int port); | 274 bool IsPortAllowedByOverride(int port); |
275 | 275 |
276 // Set socket to non-blocking mode | 276 // Set socket to non-blocking mode |
277 int SetNonBlocking(int fd); | 277 NET_API int SetNonBlocking(int fd); |
278 | 278 |
279 // Formats the host in |url| and appends it to |output|. The host formatter | 279 // Formats the host in |url| and appends it to |output|. The host formatter |
280 // takes the same accept languages component as ElideURL(). | 280 // takes the same accept languages component as ElideURL(). |
281 NET_API void AppendFormattedHost(const GURL& url, | 281 NET_API void AppendFormattedHost(const GURL& url, |
282 const std::string& languages, | 282 const std::string& languages, |
283 string16* output); | 283 string16* output); |
284 | 284 |
285 // Creates a string representation of |url|. The IDN host name may be in Unicode | 285 // Creates a string representation of |url|. The IDN host name may be in Unicode |
286 // if |languages| accepts the Unicode representation. |format_type| is a bitmask | 286 // if |languages| accepts the Unicode representation. |format_type| is a bitmask |
287 // of FormatUrlTypes, see it for details. |unescape_rules| defines how to clean | 287 // of FormatUrlTypes, see it for details. |unescape_rules| defines how to clean |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 // Returns list of network interfaces except loopback interface. If an | 458 // Returns list of network interfaces except loopback interface. If an |
459 // interface has more than one address, a separate entry is added to | 459 // interface has more than one address, a separate entry is added to |
460 // the list for each address. | 460 // the list for each address. |
461 // Can be called only on a thread that allows IO. | 461 // Can be called only on a thread that allows IO. |
462 NET_API bool GetNetworkList(NetworkInterfaceList* networks); | 462 NET_API bool GetNetworkList(NetworkInterfaceList* networks); |
463 | 463 |
464 } // namespace net | 464 } // namespace net |
465 | 465 |
466 #endif // NET_BASE_NET_UTIL_H_ | 466 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |