| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 URL_URL_UTIL_H_ | 5 #ifndef URL_URL_UTIL_H_ |
| 6 #define URL_URL_UTIL_H_ | 6 #define URL_URL_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // critical and you don't want to do the heap allocation for the std::string. | 105 // critical and you don't want to do the heap allocation for the std::string. |
| 106 // | 106 // |
| 107 // As with the url_canon::Canonicalize* functions, the charset converter can | 107 // As with the url_canon::Canonicalize* functions, the charset converter can |
| 108 // be NULL to use UTF-8 (it will be faster in this case). | 108 // be NULL to use UTF-8 (it will be faster in this case). |
| 109 // | 109 // |
| 110 // Returns true if a valid URL was produced, false if not. On failure, the | 110 // Returns true if a valid URL was produced, false if not. On failure, the |
| 111 // output and parsed structures will still be filled and will be consistent, | 111 // output and parsed structures will still be filled and will be consistent, |
| 112 // but they will not represent a loadable URL. | 112 // but they will not represent a loadable URL. |
| 113 URL_EXPORT bool Canonicalize(const char* spec, | 113 URL_EXPORT bool Canonicalize(const char* spec, |
| 114 int spec_len, | 114 int spec_len, |
| 115 bool trim_path_end, |
| 115 url_canon::CharsetConverter* charset_converter, | 116 url_canon::CharsetConverter* charset_converter, |
| 116 url_canon::CanonOutput* output, | 117 url_canon::CanonOutput* output, |
| 117 url_parse::Parsed* output_parsed); | 118 url_parse::Parsed* output_parsed); |
| 118 URL_EXPORT bool Canonicalize(const base::char16* spec, | 119 URL_EXPORT bool Canonicalize(const base::char16* spec, |
| 119 int spec_len, | 120 int spec_len, |
| 121 bool trim_path_end, |
| 120 url_canon::CharsetConverter* charset_converter, | 122 url_canon::CharsetConverter* charset_converter, |
| 121 url_canon::CanonOutput* output, | 123 url_canon::CanonOutput* output, |
| 122 url_parse::Parsed* output_parsed); | 124 url_parse::Parsed* output_parsed); |
| 123 | 125 |
| 124 // Resolves a potentially relative URL relative to the given parsed base URL. | 126 // Resolves a potentially relative URL relative to the given parsed base URL. |
| 125 // The base MUST be valid. The resulting canonical URL and parsed information | 127 // The base MUST be valid. The resulting canonical URL and parsed information |
| 126 // will be placed in to the given out variables. | 128 // will be placed in to the given out variables. |
| 127 // | 129 // |
| 128 // The relative need not be relative. If we discover that it's absolute, this | 130 // The relative need not be relative. If we discover that it's absolute, this |
| 129 // will produce a canonical version of that URL. See Canonicalize() for more | 131 // will produce a canonical version of that URL. See Canonicalize() for more |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 196 |
| 195 // Escapes the given string as defined by the JS method encodeURIComponent. See | 197 // Escapes the given string as defined by the JS method encodeURIComponent. See |
| 196 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR
IComponent | 198 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR
IComponent |
| 197 URL_EXPORT void EncodeURIComponent(const char* input, int length, | 199 URL_EXPORT void EncodeURIComponent(const char* input, int length, |
| 198 url_canon::CanonOutput* output); | 200 url_canon::CanonOutput* output); |
| 199 | 201 |
| 200 | 202 |
| 201 } // namespace url_util | 203 } // namespace url_util |
| 202 | 204 |
| 203 #endif // URL_URL_UTIL_H_ | 205 #endif // URL_URL_UTIL_H_ |
| OLD | NEW |