| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 252 |
| 253 // Gets the filename from the raw Content-Disposition header (as read from the | 253 // Gets the filename from the raw Content-Disposition header (as read from the |
| 254 // network). Otherwise uses the last path component name or hostname from | 254 // network). Otherwise uses the last path component name or hostname from |
| 255 // |url|. If there is no filename or it can't be used, the given |default_name|, | 255 // |url|. If there is no filename or it can't be used, the given |default_name|, |
| 256 // will be used unless it is empty. | 256 // will be used unless it is empty. |
| 257 | 257 |
| 258 // Note: it's possible for the suggested filename to be empty (e.g., | 258 // Note: it's possible for the suggested filename to be empty (e.g., |
| 259 // file:///). referrer_charset is used as one of charsets | 259 // file:///). referrer_charset is used as one of charsets |
| 260 // to interpret a raw 8bit string in C-D header (after interpreting | 260 // to interpret a raw 8bit string in C-D header (after interpreting |
| 261 // as UTF-8 fails). See the comment for GetFilenameFromCD for more details. | 261 // as UTF-8 fails). See the comment for GetFilenameFromCD for more details. |
| 262 FilePath GetSuggestedFilename(const GURL& url, | 262 string16 GetSuggestedFilename(const GURL& url, |
| 263 const std::string& content_disposition, | 263 const std::string& content_disposition, |
| 264 const std::string& referrer_charset, | 264 const std::string& referrer_charset, |
| 265 const FilePath& default_name); | 265 const string16& default_name); |
| 266 | 266 |
| 267 // Checks the given port against a list of ports which are restricted by | 267 // Checks the given port against a list of ports which are restricted by |
| 268 // default. Returns true if the port is allowed, false if it is restricted. | 268 // default. Returns true if the port is allowed, false if it is restricted. |
| 269 bool IsPortAllowedByDefault(int port); | 269 bool IsPortAllowedByDefault(int port); |
| 270 | 270 |
| 271 // Checks the given port against a list of ports which are restricted by the | 271 // Checks the given port against a list of ports which are restricted by the |
| 272 // FTP protocol. Returns true if the port is allowed, false if it is | 272 // FTP protocol. Returns true if the port is allowed, false if it is |
| 273 // restricted. | 273 // restricted. |
| 274 bool IsPortAllowedByFtp(int port); | 274 bool IsPortAllowedByFtp(int port); |
| 275 | 275 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 // Returns the port field of the sockaddr in |info|. | 406 // Returns the port field of the sockaddr in |info|. |
| 407 uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); | 407 uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); |
| 408 | 408 |
| 409 // Returns the value of |info's| port (in host byte ordering). | 409 // Returns the value of |info's| port (in host byte ordering). |
| 410 int GetPortFromAddrinfo(const struct addrinfo* info); | 410 int GetPortFromAddrinfo(const struct addrinfo* info); |
| 411 | 411 |
| 412 } // namespace net | 412 } // namespace net |
| 413 | 413 |
| 414 #endif // NET_BASE_NET_UTIL_H_ | 414 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |