| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #ifdef OS_WIN | 10 #ifdef OS_WIN |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 const std::string& raw_bytes, | 187 const std::string& raw_bytes, |
| 188 bool is_dir, int64 size, | 188 bool is_dir, int64 size, |
| 189 base::Time modified); | 189 base::Time modified); |
| 190 | 190 |
| 191 // If text starts with "www." it is removed, otherwise text is returned | 191 // If text starts with "www." it is removed, otherwise text is returned |
| 192 // unmodified. | 192 // unmodified. |
| 193 std::wstring StripWWW(const std::wstring& text); | 193 std::wstring StripWWW(const std::wstring& text); |
| 194 | 194 |
| 195 // Gets the filename from the raw Content-Disposition header (as read from the | 195 // Gets the filename from the raw Content-Disposition header (as read from the |
| 196 // network). Otherwise uses the last path component name or hostname from | 196 // network). Otherwise uses the last path component name or hostname from |
| 197 // |url|. If there is no filename or it can't be used, the given default name | 197 // |url|. If there is no filename or it can't be used, the given |default_name|, |
| 198 // will be used if specified. | 198 // will be used unless it is empty. |
| 199 | 199 |
| 200 // Note: it's possible for the suggested filename to be empty (e.g., | 200 // Note: it's possible for the suggested filename to be empty (e.g., |
| 201 // file:///). referrer_charset is used as one of charsets | 201 // file:///). referrer_charset is used as one of charsets |
| 202 // to interpret a raw 8bit string in C-D header (after interpreting | 202 // to interpret a raw 8bit string in C-D header (after interpreting |
| 203 // as UTF-8 fails). See the comment for GetFilenameFromCD for more details. | 203 // as UTF-8 fails). See the comment for GetFilenameFromCD for more details. |
| 204 FilePath GetSuggestedFilename(const GURL& url, | 204 FilePath GetSuggestedFilename(const GURL& url, |
| 205 const std::string& content_disposition, | 205 const std::string& content_disposition, |
| 206 const std::string& referrer_charset, | 206 const std::string& referrer_charset, |
| 207 const char* default_name); | 207 const FilePath& default_name); |
| 208 | 208 |
| 209 // Checks the given port against a list of ports which are restricted by | 209 // Checks the given port against a list of ports which are restricted by |
| 210 // default. Returns true if the port is allowed, false if it is restricted. | 210 // default. Returns true if the port is allowed, false if it is restricted. |
| 211 bool IsPortAllowedByDefault(int port); | 211 bool IsPortAllowedByDefault(int port); |
| 212 | 212 |
| 213 // Checks the given port against a list of ports which are restricted by the | 213 // Checks the given port against a list of ports which are restricted by the |
| 214 // FTP protocol. Returns true if the port is allowed, false if it is | 214 // FTP protocol. Returns true if the port is allowed, false if it is |
| 215 // restricted. | 215 // restricted. |
| 216 bool IsPortAllowedByFtp(int port); | 216 bool IsPortAllowedByFtp(int port); |
| 217 | 217 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // Strip the portions of |url| that aren't core to the network request. | 256 // Strip the portions of |url| that aren't core to the network request. |
| 257 // - user name / password | 257 // - user name / password |
| 258 // - reference section | 258 // - reference section |
| 259 GURL SimplifyUrlForRequest(const GURL& url); | 259 GURL SimplifyUrlForRequest(const GURL& url); |
| 260 | 260 |
| 261 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); | 261 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); |
| 262 | 262 |
| 263 } // namespace net | 263 } // namespace net |
| 264 | 264 |
| 265 #endif // NET_BASE_NET_UTIL_H_ | 265 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |