| 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_CANON_INTERNAL_H_ | 5 #ifndef URL_URL_CANON_INTERNAL_H_ |
| 6 #define URL_URL_CANON_INTERNAL_H_ | 6 #define URL_URL_CANON_INTERNAL_H_ |
| 7 | 7 |
| 8 // This file is intended to be included in another C++ file where the character | 8 // This file is intended to be included in another C++ file where the character |
| 9 // types are defined. This allows us to write mostly generic code, but not have | 9 // types are defined. This allows us to write mostly generic code, but not have |
| 10 // templace bloat because everything is inlined when anybody calls any of our | 10 // templace bloat because everything is inlined when anybody calls any of our |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // The given utf8_buffer is used to store the converted components. They will | 378 // The given utf8_buffer is used to store the converted components. They will |
| 379 // be appended one after another, with the parsed structure identifying the | 379 // be appended one after another, with the parsed structure identifying the |
| 380 // appropriate substrings. This buffer is a parameter because the source has | 380 // appropriate substrings. This buffer is a parameter because the source has |
| 381 // no storage, so the buffer must have the same lifetime as the source | 381 // no storage, so the buffer must have the same lifetime as the source |
| 382 // parameter owned by the caller. | 382 // parameter owned by the caller. |
| 383 // | 383 // |
| 384 // THE CALLER MUST NOT ADD TO THE |utf8_buffer| AFTER THIS CALL. Members of | 384 // THE CALLER MUST NOT ADD TO THE |utf8_buffer| AFTER THIS CALL. Members of |
| 385 // |source| will point into this buffer, which could be invalidated if | 385 // |source| will point into this buffer, which could be invalidated if |
| 386 // additional data is added and the CanonOutput resizes its buffer. | 386 // additional data is added and the CanonOutput resizes its buffer. |
| 387 // | 387 // |
| 388 // Returns true on success. Fales means that the input was not valid UTF-16, | 388 // Returns true on success. False means that the input was not valid UTF-16, |
| 389 // although we will have still done the override with "invalid characters" in | 389 // although we will have still done the override with "invalid characters" in |
| 390 // place of errors. | 390 // place of errors. |
| 391 bool SetupUTF16OverrideComponents(const char* base, | 391 bool SetupUTF16OverrideComponents(const char* base, |
| 392 const Replacements<base::char16>& repl, | 392 const Replacements<base::char16>& repl, |
| 393 CanonOutput* utf8_buffer, | 393 CanonOutput* utf8_buffer, |
| 394 URLComponentSource<char>* source, | 394 URLComponentSource<char>* source, |
| 395 url_parse::Parsed* parsed); | 395 url_parse::Parsed* parsed); |
| 396 | 396 |
| 397 // Implemented in url_canon_path.cc, these are required by the relative URL | 397 // Implemented in url_canon_path.cc, these are required by the relative URL |
| 398 // resolver as well, so we declare them here. | 398 // resolver as well, so we declare them here. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 428 inline unsigned long long _strtoui64(const char* nptr, | 428 inline unsigned long long _strtoui64(const char* nptr, |
| 429 char** endptr, int base) { | 429 char** endptr, int base) { |
| 430 return strtoull(nptr, endptr, base); | 430 return strtoull(nptr, endptr, base); |
| 431 } | 431 } |
| 432 | 432 |
| 433 #endif // WIN32 | 433 #endif // WIN32 |
| 434 | 434 |
| 435 } // namespace url_canon | 435 } // namespace url_canon |
| 436 | 436 |
| 437 #endif // URL_URL_CANON_INTERNAL_H_ | 437 #endif // URL_URL_CANON_INTERNAL_H_ |
| OLD | NEW |