diff options
34 files changed, 277 insertions, 260 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 7774e4f..75c6358 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -180,7 +180,7 @@ UScriptCode NormalizeScript(UScriptCode code) { } } -bool IsIDNComponentInSingleScript(const char16* str, int str_len) { +bool IsIDNComponentInSingleScript(const base::char16* str, int str_len) { UScriptCode first_script = USCRIPT_INVALID_CODE; bool is_first = true; @@ -301,7 +301,7 @@ bool IsComponentCoveredByLang(const icu::UnicodeSet& component_characters, // Returns true if the given Unicode host component is safe to display to the // user. -bool IsIDNComponentSafe(const char16* str, +bool IsIDNComponentSafe(const base::char16* str, int str_len, const std::string& languages) { // Most common cases (non-IDN) do not reach here so that we don't @@ -399,7 +399,7 @@ bool IsIDNComponentSafe(const char16* str, // will be APPENDED to the given output string and will be the same as the input // if it is not IDN or the IDN is unsafe to display. Returns whether any // conversion was performed. -bool IDNToUnicodeOneComponent(const char16* comp, +bool IDNToUnicodeOneComponent(const base::char16* comp, size_t comp_len, const std::string& languages, base::string16* out) { @@ -408,9 +408,9 @@ bool IDNToUnicodeOneComponent(const char16* comp, return false; // Only transform if the input can be an IDN component. - static const char16 kIdnPrefix[] = {'x', 'n', '-', '-'}; + static const base::char16 kIdnPrefix[] = {'x', 'n', '-', '-'}; if ((comp_len > arraysize(kIdnPrefix)) && - !memcmp(comp, kIdnPrefix, arraysize(kIdnPrefix) * sizeof(char16))) { + !memcmp(comp, kIdnPrefix, arraysize(kIdnPrefix) * sizeof(base::char16))) { // Repeatedly expand the output string until it's big enough. It looks like // ICU will return the required size of the buffer, but that's not // documented, so we'll just grow by 2x. This should be rare and is not on a diff --git a/net/base/zap.cc b/net/base/zap.cc index e2d3ffb..331d696 100644 --- a/net/base/zap.cc +++ b/net/base/zap.cc @@ -17,7 +17,7 @@ void ZapString(std::string* s) { void ZapString(base::string16* s) { if (!s->empty()) - ZapBuf(&(*s)[0], s->length() * sizeof(char16)); + ZapBuf(&(*s)[0], s->length() * sizeof(base::char16)); } } // net diff --git a/net/cert/x509_cert_types_mac.cc b/net/cert/x509_cert_types_mac.cc index a41b690..6439c7f 100644 --- a/net/cert/x509_cert_types_mac.cc +++ b/net/cert/x509_cert_types_mac.cc @@ -121,7 +121,7 @@ std::string Latin1DataToUTF8String(CSSM_DATA data) { // Converts big-endian UTF-16 to UTF-8 in a std::string. // Note: The byte-order flipping is done in place on the input buffer! -bool UTF16BigEndianToUTF8(char16* chars, size_t length, +bool UTF16BigEndianToUTF8(base::char16* chars, size_t length, std::string* out_string) { for (size_t i = 0; i < length; i++) chars[i] = EndianU16_BtoN(chars[i]); @@ -241,9 +241,10 @@ bool CertPrincipal::ParseDistinguishedName(const void* ber_name_data, break; case BER_TAG_PKIX_BMP_STRING: { // UTF-16, big-endian std::string value; - UTF16BigEndianToUTF8(reinterpret_cast<char16*>(pair->value.Data), - pair->value.Length / sizeof(char16), - &value); + UTF16BigEndianToUTF8( + reinterpret_cast<base::char16*>(pair->value.Data), + pair->value.Length / sizeof(base::char16), + &value); AddTypeValuePair(pair->type, value, values); break; } diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc index b55581e..4c04234 100644 --- a/net/http/http_auth_handler_ntlm.cc +++ b/net/http/http_auth_handler_ntlm.cc @@ -55,7 +55,7 @@ int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( base::string16 domain; base::string16 user; const base::string16& username = credentials->username(); - const char16 backslash_character = '\\'; + const base::char16 backslash_character = '\\'; size_t backslash_idx = username.find(backslash_character); if (backslash_idx == base::string16::npos) { user = username; diff --git a/url/gurl.cc b/url/gurl.cc index 9753152..3dd8463 100644 --- a/url/gurl.cc +++ b/url/gurl.cc @@ -102,7 +102,7 @@ GURL::GURL(const std::string& url_string) : inner_url_(NULL) { } } -GURL::GURL(const string16& url_string) : inner_url_(NULL) { +GURL::GURL(const base::string16& url_string) : inner_url_(NULL) { is_valid_ = InitCanonical(url_string, &spec_, &parsed_); if (is_valid_ && SchemeIsFileSystem()) { inner_url_ = @@ -179,7 +179,7 @@ const std::string& GURL::spec() const { GURL GURL::Resolve(const std::string& relative) const { return ResolveWithCharsetConverter(relative, NULL); } -GURL GURL::Resolve(const string16& relative) const { +GURL GURL::Resolve(const base::string16& relative) const { return ResolveWithCharsetConverter(relative, NULL); } @@ -217,7 +217,7 @@ GURL GURL::ResolveWithCharsetConverter( // Note: code duplicated above (it's inconvenient to use a template here). GURL GURL::ResolveWithCharsetConverter( - const string16& relative, + const base::string16& relative, url_canon::CharsetConverter* charset_converter) const { // Not allowed for invalid URLs. if (!is_valid_) @@ -275,7 +275,7 @@ GURL GURL::ReplaceComponents( // Note: code duplicated above (it's inconvenient to use a template here). GURL GURL::ReplaceComponents( - const url_canon::Replacements<char16>& replacements) const { + const url_canon::Replacements<base::char16>& replacements) const { GURL result; // Not allowed for invalid URLs. @@ -17,7 +17,7 @@ class URL_EXPORT GURL { public: typedef url_canon::StdStringReplacements<std::string> Replacements; - typedef url_canon::StdStringReplacements<string16> ReplacementsW; + typedef url_canon::StdStringReplacements<base::string16> ReplacementsW; // Creates an empty, invalid URL. GURL(); @@ -34,7 +34,7 @@ class URL_EXPORT GURL { // version to assume the query parameter encoding should be the same as the // input encoding. explicit GURL(const std::string& url_string /*, output_param_encoding*/); - explicit GURL(const string16& url_string /*, output_param_encoding*/); + explicit GURL(const base::string16& url_string /*, output_param_encoding*/); // Constructor for URLs that have already been parsed and canonicalized. This // is used for conversions from KURL, for example. The caller must supply all @@ -129,7 +129,7 @@ class URL_EXPORT GURL { // It is an error to resolve a URL relative to an invalid URL. The result // will be the empty URL. GURL Resolve(const std::string& relative) const; - GURL Resolve(const string16& relative) const; + GURL Resolve(const base::string16& relative) const; // Like Resolve() above but takes a character set encoder which will be used // for any query text specified in the input. The charset converter parameter @@ -142,7 +142,7 @@ class URL_EXPORT GURL { const std::string& relative, url_canon::CharsetConverter* charset_converter) const; GURL ResolveWithCharsetConverter( - const string16& relative, + const base::string16& relative, url_canon::CharsetConverter* charset_converter) const; // Creates a new GURL by replacing the current URL's components with the @@ -159,7 +159,7 @@ class URL_EXPORT GURL { GURL ReplaceComponents( const url_canon::Replacements<char>& replacements) const; GURL ReplaceComponents( - const url_canon::Replacements<char16>& replacements) const; + const url_canon::Replacements<base::char16>& replacements) const; // A helper function that is equivalent to replacing the path with a slash // and clearing out everything after that. We sometimes need to know just the diff --git a/url/url_canon.h b/url/url_canon.h index 7d4b75a..b33d13a 100644 --- a/url/url_canon.h +++ b/url/url_canon.h @@ -172,12 +172,12 @@ class RawCanonOutputT : public CanonOutputT<T> { // the templates so it can also be used internally if a wide buffer is // required. typedef CanonOutputT<char> CanonOutput; -typedef CanonOutputT<char16> CanonOutputW; +typedef CanonOutputT<base::char16> CanonOutputW; template<int fixed_capacity> class RawCanonOutput : public RawCanonOutputT<char, fixed_capacity> {}; template<int fixed_capacity> -class RawCanonOutputW : public RawCanonOutputT<char16, fixed_capacity> {}; +class RawCanonOutputW : public RawCanonOutputT<base::char16, fixed_capacity> {}; // Character set converter ---------------------------------------------------- // @@ -203,7 +203,7 @@ class URL_EXPORT CharsetConverter { // decimal, (such as "你") with escaping of the ampersand, number // sign, and semicolon (in the previous example it would be // "%26%2320320%3B"). This rule is based on what IE does in this situation. - virtual void ConvertFromUTF16(const char16* input, + virtual void ConvertFromUTF16(const base::char16* input, int input_len, CanonOutput* output) = 0; }; @@ -223,14 +223,16 @@ class URL_EXPORT CharsetConverter { // required, the given |buffer| will be used and the returned pointer will // point to the beginning of the buffer. // -// Therefore, callers should not use the buffer, since it may actuall be empty, +// Therefore, callers should not use the buffer, since it may actually be empty, // use the computed pointer and |*output_len| instead. URL_EXPORT const char* RemoveURLWhitespace(const char* input, int input_len, CanonOutputT<char>* buffer, int* output_len); -URL_EXPORT const char16* RemoveURLWhitespace(const char16* input, int input_len, - CanonOutputT<char16>* buffer, - int* output_len); +URL_EXPORT const base::char16* RemoveURLWhitespace( + const base::char16* input, + int input_len, + CanonOutputT<base::char16>* buffer, + int* output_len); // IDN ------------------------------------------------------------------------ @@ -243,7 +245,7 @@ URL_EXPORT const char16* RemoveURLWhitespace(const char16* input, int input_len, // the length of the output will be set to the length of the new host name. // // On error, returns false. The output in this case is undefined. -URL_EXPORT bool IDNToASCII(const char16* src, +URL_EXPORT bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output); @@ -275,7 +277,7 @@ URL_EXPORT bool CanonicalizeScheme(const char* spec, const url_parse::Component& scheme, CanonOutput* output, url_parse::Component* out_scheme); -URL_EXPORT bool CanonicalizeScheme(const char16* spec, +URL_EXPORT bool CanonicalizeScheme(const base::char16* spec, const url_parse::Component& scheme, CanonOutput* output, url_parse::Component* out_scheme); @@ -297,9 +299,9 @@ URL_EXPORT bool CanonicalizeUserInfo(const char* username_source, CanonOutput* output, url_parse::Component* out_username, url_parse::Component* out_password); -URL_EXPORT bool CanonicalizeUserInfo(const char16* username_source, +URL_EXPORT bool CanonicalizeUserInfo(const base::char16* username_source, const url_parse::Component& username, - const char16* password_source, + const base::char16* password_source, const url_parse::Component& password, CanonOutput* output, url_parse::Component* out_username, @@ -360,7 +362,7 @@ URL_EXPORT bool CanonicalizeHost(const char* spec, const url_parse::Component& host, CanonOutput* output, url_parse::Component* out_host); -URL_EXPORT bool CanonicalizeHost(const char16* spec, +URL_EXPORT bool CanonicalizeHost(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, url_parse::Component* out_host); @@ -373,7 +375,7 @@ URL_EXPORT void CanonicalizeHostVerbose(const char* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo* host_info); -URL_EXPORT void CanonicalizeHostVerbose(const char16* spec, +URL_EXPORT void CanonicalizeHostVerbose(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo* host_info); @@ -393,7 +395,7 @@ URL_EXPORT void CanonicalizeIPAddress(const char* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo* host_info); -URL_EXPORT void CanonicalizeIPAddress(const char16* spec, +URL_EXPORT void CanonicalizeIPAddress(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo* host_info); @@ -408,7 +410,7 @@ URL_EXPORT bool CanonicalizePort(const char* spec, int default_port_for_scheme, CanonOutput* output, url_parse::Component* out_port); -URL_EXPORT bool CanonicalizePort(const char16* spec, +URL_EXPORT bool CanonicalizePort(const base::char16* spec, const url_parse::Component& port, int default_port_for_scheme, CanonOutput* output, @@ -431,7 +433,7 @@ URL_EXPORT bool CanonicalizePath(const char* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); -URL_EXPORT bool CanonicalizePath(const char16* spec, +URL_EXPORT bool CanonicalizePath(const base::char16* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); @@ -446,7 +448,7 @@ URL_EXPORT bool FileCanonicalizePath(const char* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); -URL_EXPORT bool FileCanonicalizePath(const char16* spec, +URL_EXPORT bool FileCanonicalizePath(const base::char16* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); @@ -468,7 +470,7 @@ URL_EXPORT void CanonicalizeQuery(const char* spec, CharsetConverter* converter, CanonOutput* output, url_parse::Component* out_query); -URL_EXPORT void CanonicalizeQuery(const char16* spec, +URL_EXPORT void CanonicalizeQuery(const base::char16* spec, const url_parse::Component& query, CharsetConverter* converter, CanonOutput* output, @@ -484,7 +486,7 @@ URL_EXPORT void CanonicalizeRef(const char* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); -URL_EXPORT void CanonicalizeRef(const char16* spec, +URL_EXPORT void CanonicalizeRef(const base::char16* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path); @@ -506,7 +508,7 @@ URL_EXPORT bool CanonicalizeStandardURL(const char* spec, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool CanonicalizeStandardURL(const char16* spec, +URL_EXPORT bool CanonicalizeStandardURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* query_converter, @@ -520,7 +522,7 @@ URL_EXPORT bool CanonicalizeFileURL(const char* spec, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool CanonicalizeFileURL(const char16* spec, +URL_EXPORT bool CanonicalizeFileURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* query_converter, @@ -534,7 +536,7 @@ URL_EXPORT bool CanonicalizeFileSystemURL(const char* spec, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool CanonicalizeFileSystemURL(const char16* spec, +URL_EXPORT bool CanonicalizeFileSystemURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* query_converter, @@ -548,7 +550,7 @@ URL_EXPORT bool CanonicalizePathURL(const char* spec, const url_parse::Parsed& parsed, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool CanonicalizePathURL(const char16* spec, +URL_EXPORT bool CanonicalizePathURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CanonOutput* output, @@ -564,7 +566,7 @@ URL_EXPORT bool CanonicalizeMailtoURL(const char* spec, const url_parse::Parsed& parsed, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool CanonicalizeMailtoURL(const char16* spec, +URL_EXPORT bool CanonicalizeMailtoURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CanonOutput* output, @@ -759,12 +761,13 @@ URL_EXPORT bool ReplaceStandardURL(const char* base, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool ReplaceStandardURL(const char* base, - const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, - CharsetConverter* query_converter, - CanonOutput* output, - url_parse::Parsed* new_parsed); +URL_EXPORT bool ReplaceStandardURL( + const char* base, + const url_parse::Parsed& base_parsed, + const Replacements<base::char16>& replacements, + CharsetConverter* query_converter, + CanonOutput* output, + url_parse::Parsed* new_parsed); // Filesystem URLs can only have the path, query, or ref replaced. // All other components will be ignored. @@ -774,12 +777,13 @@ URL_EXPORT bool ReplaceFileSystemURL(const char* base, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); -URL_EXPORT bool ReplaceFileSystemURL(const char* base, - const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, - CharsetConverter* query_converter, - CanonOutput* output, - url_parse::Parsed* new_parsed); +URL_EXPORT bool ReplaceFileSystemURL( + const char* base, + const url_parse::Parsed& base_parsed, + const Replacements<base::char16>& replacements, + CharsetConverter* query_converter, + CanonOutput* output, + url_parse::Parsed* new_parsed); // Replacing some parts of a file URL is not permitted. Everything except // the host, path, query, and ref will be ignored. @@ -791,7 +795,7 @@ URL_EXPORT bool ReplaceFileURL(const char* base, url_parse::Parsed* new_parsed); URL_EXPORT bool ReplaceFileURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed); @@ -805,7 +809,7 @@ URL_EXPORT bool ReplacePathURL(const char* base, url_parse::Parsed* new_parsed); URL_EXPORT bool ReplacePathURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CanonOutput* output, url_parse::Parsed* new_parsed); @@ -818,7 +822,7 @@ URL_EXPORT bool ReplaceMailtoURL(const char* base, url_parse::Parsed* new_parsed); URL_EXPORT bool ReplaceMailtoURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CanonOutput* output, url_parse::Parsed* new_parsed); @@ -844,7 +848,7 @@ URL_EXPORT bool IsRelativeURL(const char* base, url_parse::Component* relative_component); URL_EXPORT bool IsRelativeURL(const char* base, const url_parse::Parsed& base_parsed, - const char16* fragment, + const base::char16* fragment, int fragment_len, bool is_base_hierarchical, bool* is_relative, @@ -881,7 +885,7 @@ URL_EXPORT bool ResolveRelativeURL( const char* base_url, const url_parse::Parsed& base_parsed, bool base_is_file, - const char16* relative_url, + const base::char16* relative_url, const url_parse::Component& relative_component, CharsetConverter* query_converter, CanonOutput* output, diff --git a/url/url_canon_etc.cc b/url/url_canon_etc.cc index cad68a5..a1512f6 100644 --- a/url/url_canon_etc.cc +++ b/url/url_canon_etc.cc @@ -281,13 +281,14 @@ const char* RemoveURLWhitespace(const char* input, int input_len, return DoRemoveURLWhitespace(input, input_len, buffer, output_len); } -const char16* RemoveURLWhitespace(const char16* input, int input_len, - CanonOutputT<char16>* buffer, - int* output_len) { +const base::char16* RemoveURLWhitespace(const base::char16* input, + int input_len, + CanonOutputT<base::char16>* buffer, + int* output_len) { return DoRemoveURLWhitespace(input, input_len, buffer, output_len); } -char CanonicalSchemeChar(char16 ch) { +char CanonicalSchemeChar(base::char16 ch) { if (ch >= 0x80) return 0; // Non-ASCII is not supported by schemes. return kSchemeCanonical[ch]; @@ -300,11 +301,11 @@ bool CanonicalizeScheme(const char* spec, return DoScheme<char, unsigned char>(spec, scheme, output, out_scheme); } -bool CanonicalizeScheme(const char16* spec, +bool CanonicalizeScheme(const base::char16* spec, const url_parse::Component& scheme, CanonOutput* output, url_parse::Component* out_scheme) { - return DoScheme<char16, char16>(spec, scheme, output, out_scheme); + return DoScheme<base::char16, base::char16>(spec, scheme, output, out_scheme); } bool CanonicalizeUserInfo(const char* username_source, @@ -319,14 +320,14 @@ bool CanonicalizeUserInfo(const char* username_source, output, out_username, out_password); } -bool CanonicalizeUserInfo(const char16* username_source, +bool CanonicalizeUserInfo(const base::char16* username_source, const url_parse::Component& username, - const char16* password_source, + const base::char16* password_source, const url_parse::Component& password, CanonOutput* output, url_parse::Component* out_username, url_parse::Component* out_password) { - return DoUserInfo<char16, char16>( + return DoUserInfo<base::char16, base::char16>( username_source, username, password_source, password, output, out_username, out_password); } @@ -341,13 +342,13 @@ bool CanonicalizePort(const char* spec, output, out_port); } -bool CanonicalizePort(const char16* spec, +bool CanonicalizePort(const base::char16* spec, const url_parse::Component& port, int default_port_for_scheme, CanonOutput* output, url_parse::Component* out_port) { - return DoPort<char16, char16>(spec, port, default_port_for_scheme, - output, out_port); + return DoPort<base::char16, base::char16>(spec, port, default_port_for_scheme, + output, out_port); } void CanonicalizeRef(const char* spec, @@ -357,11 +358,11 @@ void CanonicalizeRef(const char* spec, DoCanonicalizeRef<char, unsigned char>(spec, ref, output, out_ref); } -void CanonicalizeRef(const char16* spec, +void CanonicalizeRef(const base::char16* spec, const url_parse::Component& ref, CanonOutput* output, url_parse::Component* out_ref) { - DoCanonicalizeRef<char16, char16>(spec, ref, output, out_ref); + DoCanonicalizeRef<base::char16, base::char16>(spec, ref, output, out_ref); } } // namespace url_canon diff --git a/url/url_canon_filesystemurl.cc b/url/url_canon_filesystemurl.cc index e563309..7f1d393 100644 --- a/url/url_canon_filesystemurl.cc +++ b/url/url_canon_filesystemurl.cc @@ -92,15 +92,15 @@ bool CanonicalizeFileSystemURL(const char* spec, new_parsed); } -bool CanonicalizeFileSystemURL(const char16* spec, +bool CanonicalizeFileSystemURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* charset_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { - return DoCanonicalizeFileSystemURL<char16, char16>( - spec, URLComponentSource<char16>(spec), parsed, charset_converter, output, - new_parsed); + return DoCanonicalizeFileSystemURL<base::char16, base::char16>( + spec, URLComponentSource<base::char16>(spec), parsed, charset_converter, + output, new_parsed); } bool ReplaceFileSystemURL(const char* base, @@ -118,7 +118,7 @@ bool ReplaceFileSystemURL(const char* base, bool ReplaceFileSystemURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CharsetConverter* charset_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { diff --git a/url/url_canon_fileurl.cc b/url/url_canon_fileurl.cc index 1130a97..123583a 100644 --- a/url/url_canon_fileurl.cc +++ b/url/url_canon_fileurl.cc @@ -133,14 +133,14 @@ bool CanonicalizeFileURL(const char* spec, output, new_parsed); } -bool CanonicalizeFileURL(const char16* spec, +bool CanonicalizeFileURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { - return DoCanonicalizeFileURL<char16, char16>( - URLComponentSource<char16>(spec), parsed, query_converter, + return DoCanonicalizeFileURL<base::char16, base::char16>( + URLComponentSource<base::char16>(spec), parsed, query_converter, output, new_parsed); } @@ -152,12 +152,12 @@ bool FileCanonicalizePath(const char* spec, output, out_path); } -bool FileCanonicalizePath(const char16* spec, +bool FileCanonicalizePath(const base::char16* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path) { - return DoFileCanonicalizePath<char16, char16>(spec, path, - output, out_path); + return DoFileCanonicalizePath<base::char16, base::char16>(spec, path, + output, out_path); } bool ReplaceFileURL(const char* base, @@ -175,7 +175,7 @@ bool ReplaceFileURL(const char* base, bool ReplaceFileURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { diff --git a/url/url_canon_host.cc b/url/url_canon_host.cc index 74be649..9530652 100644 --- a/url/url_canon_host.cc +++ b/url/url_canon_host.cc @@ -69,7 +69,7 @@ const unsigned char kHostCharLookup[0x80] = { const int kTempHostBufferLen = 1024; typedef RawCanonOutputT<char, kTempHostBufferLen> StackBuffer; -typedef RawCanonOutputT<char16, kTempHostBufferLen> StackBufferW; +typedef RawCanonOutputT<base::char16, kTempHostBufferLen> StackBufferW; // Scans a host name and fills in the output flags according to what we find. // |has_non_ascii| will be true if there are any non-7-bit characters, and @@ -162,7 +162,7 @@ bool DoSimpleHost(const INCHAR* host, } // Canonicalizes a host that requires IDN conversion. Returns true on success -bool DoIDNHost(const char16* src, int src_len, CanonOutput* output) { +bool DoIDNHost(const base::char16* src, int src_len, CanonOutput* output) { // We need to escape URL before doing IDN conversion, since punicode strings // cannot be escaped after they are created. RawCanonOutputW<kTempHostBufferLen> url_escaped_host; @@ -255,7 +255,7 @@ bool DoComplexHost(const char* host, int host_len, // UTF-16 convert host to its ASCII version. The set up is already ready for // the backend, so we just pass through. The has_escaped flag should be set if // the input string requires unescaping. -bool DoComplexHost(const char16* host, int host_len, +bool DoComplexHost(const base::char16* host, int host_len, bool has_non_ascii, bool has_escaped, CanonOutput* output) { if (has_escaped) { // Yikes, we have escaped characters with wide input. The escaped @@ -349,12 +349,12 @@ bool CanonicalizeHost(const char* spec, return (host_info.family != CanonHostInfo::BROKEN); } -bool CanonicalizeHost(const char16* spec, +bool CanonicalizeHost(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, url_parse::Component* out_host) { CanonHostInfo host_info; - DoHost<char16, char16>(spec, host, output, &host_info); + DoHost<base::char16, base::char16>(spec, host, output, &host_info); *out_host = host_info.out_host; return (host_info.family != CanonHostInfo::BROKEN); } @@ -366,11 +366,11 @@ void CanonicalizeHostVerbose(const char* spec, DoHost<char, unsigned char>(spec, host, output, host_info); } -void CanonicalizeHostVerbose(const char16* spec, +void CanonicalizeHostVerbose(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo *host_info) { - DoHost<char16, char16>(spec, host, output, host_info); + DoHost<base::char16, base::char16>(spec, host, output, host_info); } } // namespace url_canon diff --git a/url/url_canon_icu.cc b/url/url_canon_icu.cc index 8699202..95e9c13 100644 --- a/url/url_canon_icu.cc +++ b/url/url_canon_icu.cc @@ -80,7 +80,7 @@ ICUCharsetConverter::ICUCharsetConverter(UConverter* converter) ICUCharsetConverter::~ICUCharsetConverter() { } -void ICUCharsetConverter::ConvertFromUTF16(const char16* input, +void ICUCharsetConverter::ConvertFromUTF16(const base::char16* input, int input_len, CanonOutput* output) { // Install our error handler. It will be called for character that can not @@ -116,7 +116,7 @@ void ICUCharsetConverter::ConvertFromUTF16(const char16* input, // the length of the output will be set to the length of the new host name. // // On error, this will return false. The output in this case is undefined. -bool IDNToASCII(const char16* src, int src_len, CanonOutputW* output) { +bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output) { DCHECK(output->length() == 0); // Output buffer is assumed empty. while (true) { // Use ALLOW_UNASSIGNED to be more tolerant of hostnames that violate @@ -155,7 +155,7 @@ bool ReadUTFChar(const char* str, int* begin, int length, return false; } -bool ReadUTFChar(const char16* str, int* begin, int length, +bool ReadUTFChar(const base::char16* str, int* begin, int length, unsigned* code_point) { if (U16_IS_SURROGATE(str[*begin])) { if (!U16_IS_SURROGATE_LEAD(str[*begin]) || *begin + 1 >= length || diff --git a/url/url_canon_icu.h b/url/url_canon_icu.h index 1f9f092..9bfd643e 100644 --- a/url/url_canon_icu.h +++ b/url/url_canon_icu.h @@ -25,7 +25,7 @@ class URL_EXPORT ICUCharsetConverter : public CharsetConverter { virtual ~ICUCharsetConverter(); - virtual void ConvertFromUTF16(const char16* input, + virtual void ConvertFromUTF16(const base::char16* input, int input_len, CanonOutput* output); diff --git a/url/url_canon_internal.cc b/url/url_canon_internal.cc index e274c60..8b4bf21 100644 --- a/url/url_canon_internal.cc +++ b/url/url_canon_internal.cc @@ -83,7 +83,7 @@ void DoOverrideComponent(const char* override_source, // caller should use the beginning of the |utf8_buffer| as the string pointer // for all components once all overrides have been prepared. bool PrepareUTF16OverrideComponent( - const char16* override_source, + const base::char16* override_source, const url_parse::Component& override_component, CanonOutput* utf8_buffer, url_parse::Component* dest_component) { @@ -231,7 +231,7 @@ const char kCharToHexLookup[8] = { 0, // 0xE0 - 0xFF }; -const char16 kUnicodeReplacementCharacter = 0xfffd; +const base::char16 kUnicodeReplacementCharacter = 0xfffd; void AppendStringOfType(const char* source, int length, SharedCharTypes type, @@ -239,10 +239,11 @@ void AppendStringOfType(const char* source, int length, DoAppendStringOfType<char, unsigned char>(source, length, type, output); } -void AppendStringOfType(const char16* source, int length, +void AppendStringOfType(const base::char16* source, int length, SharedCharTypes type, CanonOutput* output) { - DoAppendStringOfType<char16, char16>(source, length, type, output); + DoAppendStringOfType<base::char16, base::char16>( + source, length, type, output); } void AppendInvalidNarrowString(const char* spec, int begin, int end, @@ -250,12 +251,13 @@ void AppendInvalidNarrowString(const char* spec, int begin, int end, DoAppendInvalidNarrowString<char, unsigned char>(spec, begin, end, output); } -void AppendInvalidNarrowString(const char16* spec, int begin, int end, +void AppendInvalidNarrowString(const base::char16* spec, int begin, int end, CanonOutput* output) { - DoAppendInvalidNarrowString<char16, char16>(spec, begin, end, output); + DoAppendInvalidNarrowString<base::char16, base::char16>( + spec, begin, end, output); } -bool ConvertUTF16ToUTF8(const char16* input, int input_len, +bool ConvertUTF16ToUTF8(const base::char16* input, int input_len, CanonOutput* output) { bool success = true; for (int i = 0; i < input_len; i++) { @@ -267,7 +269,7 @@ bool ConvertUTF16ToUTF8(const char16* input, int input_len, } bool ConvertUTF8ToUTF16(const char* input, int input_len, - CanonOutputT<char16>* output) { + CanonOutputT<base::char16>* output) { bool success = true; for (int i = 0; i < input_len; i++) { unsigned code_point; @@ -309,14 +311,14 @@ void SetupOverrideComponents(const char* base, } bool SetupUTF16OverrideComponents(const char* base, - const Replacements<char16>& repl, + const Replacements<base::char16>& repl, CanonOutput* utf8_buffer, URLComponentSource<char>* source, url_parse::Parsed* parsed) { bool success = true; // Get the source and parsed structures of the things we are replacing. - const URLComponentSource<char16>& repl_source = repl.sources(); + const URLComponentSource<base::char16>& repl_source = repl.sources(); const url_parse::Parsed& repl_parsed = repl.components(); success &= PrepareUTF16OverrideComponent( @@ -378,7 +380,7 @@ int _itoa_s(int value, char* buffer, size_t size_in_chars, int radix) { return 0; } -int _itow_s(int value, char16* buffer, size_t size_in_chars, int radix) { +int _itow_s(int value, base::char16* buffer, size_t size_in_chars, int radix) { if (radix != 10) return EINVAL; @@ -392,7 +394,7 @@ int _itow_s(int value, char16* buffer, size_t size_in_chars, int radix) { } for (int i = 0; i < written; ++i) { - buffer[i] = static_cast<char16>(temp[i]); + buffer[i] = static_cast<base::char16>(temp[i]); } buffer[written] = '\0'; return 0; diff --git a/url/url_canon_internal.h b/url/url_canon_internal.h index 23adc9e..95fe2c0 100644 --- a/url/url_canon_internal.h +++ b/url/url_canon_internal.h @@ -77,7 +77,7 @@ inline bool IsComponentChar(unsigned char c) { void AppendStringOfType(const char* source, int length, SharedCharTypes type, CanonOutput* output); -void AppendStringOfType(const char16* source, int length, +void AppendStringOfType(const base::char16* source, int length, SharedCharTypes type, CanonOutput* output); @@ -121,7 +121,7 @@ inline int IsDot(const CHAR* spec, int offset, int end) { // required for relative URL resolving to test for scheme equality. // // Returns 0 if the input character is not a valid scheme character. -char CanonicalSchemeChar(char16 ch); +char CanonicalSchemeChar(base::char16 ch); // Write a single character, escaped, to the output. This always escapes: it // does no checking that thee character requires escaping. @@ -136,7 +136,7 @@ inline void AppendEscapedChar(UINCHAR ch, } // The character we'll substitute for undecodable or invalid characters. -extern const char16 kUnicodeReplacementCharacter; +extern const base::char16 kUnicodeReplacementCharacter; // UTF-8 functions ------------------------------------------------------------ @@ -227,17 +227,17 @@ inline void AppendUTF8EscapedValue(unsigned char_value, CanonOutput* output) { // (for a single-16-bit-word character, it will not be changed). // // Implementation is in url_canon_icu.cc. -URL_EXPORT bool ReadUTFChar(const char16* str, int* begin, int length, +URL_EXPORT bool ReadUTFChar(const base::char16* str, int* begin, int length, unsigned* code_point); // Equivalent to U16_APPEND_UNSAFE in ICU but uses our output method. inline void AppendUTF16Value(unsigned code_point, - CanonOutputT<char16>* output) { + CanonOutputT<base::char16>* output) { if (code_point > 0xffff) { - output->push_back(static_cast<char16>((code_point >> 10) + 0xd7c0)); - output->push_back(static_cast<char16>((code_point & 0x3ff) | 0xdc00)); + output->push_back(static_cast<base::char16>((code_point >> 10) + 0xd7c0)); + output->push_back(static_cast<base::char16>((code_point & 0x3ff) | 0xdc00)); } else { - output->push_back(static_cast<char16>(code_point)); + output->push_back(static_cast<base::char16>(code_point)); } } @@ -262,8 +262,8 @@ inline void AppendUTF16Value(unsigned code_point, // // Assumes that ch[begin] is within range in the array, but does not assume // that any following characters are. -inline bool AppendUTF8EscapedChar(const char16* str, int* begin, int length, - CanonOutput* output) { +inline bool AppendUTF8EscapedChar(const base::char16* str, int* begin, + int length, CanonOutput* output) { // UTF-16 input. Readchar16 will handle invalid characters for us and give // us the kUnicodeReplacementCharacter, so we don't have to do special // checking after failure, just pass through the failure to the caller. @@ -297,7 +297,7 @@ inline bool AppendUTF8EscapedChar(const char* str, int* begin, int length, inline bool Is8BitChar(char c) { return true; // this case is specialized to avoid a warning } -inline bool Is8BitChar(char16 c) { +inline bool Is8BitChar(base::char16 c) { return c <= 255; } @@ -333,7 +333,7 @@ inline bool DecodeEscaped(const CHAR* spec, int* begin, int end, // the escaping rules are not guaranteed! void AppendInvalidNarrowString(const char* spec, int begin, int end, CanonOutput* output); -void AppendInvalidNarrowString(const char16* spec, int begin, int end, +void AppendInvalidNarrowString(const base::char16* spec, int begin, int end, CanonOutput* output); // Misc canonicalization helpers ---------------------------------------------- @@ -346,14 +346,14 @@ void AppendInvalidNarrowString(const char16* spec, int begin, int end, // replacing the invalid characters with the "invalid character". It will // return false in the failure case, and the caller should not continue as // normal. -URL_EXPORT bool ConvertUTF16ToUTF8(const char16* input, int input_len, +URL_EXPORT bool ConvertUTF16ToUTF8(const base::char16* input, int input_len, CanonOutput* output); URL_EXPORT bool ConvertUTF8ToUTF16(const char* input, int input_len, - CanonOutputT<char16>* output); + CanonOutputT<base::char16>* output); // Converts from UTF-16 to 8-bit using the character set converter. If the // converter is NULL, this will use UTF-8. -void ConvertUTF16ToQueryEncoding(const char16* input, +void ConvertUTF16ToQueryEncoding(const base::char16* input, const url_parse::Component& query, CharsetConverter* converter, CanonOutput* output); @@ -389,7 +389,7 @@ void SetupOverrideComponents(const char* base, // although we will have still done the override with "invalid characters" in // place of errors. bool SetupUTF16OverrideComponents(const char* base, - const Replacements<char16>& repl, + const Replacements<base::char16>& repl, CanonOutput* utf8_buffer, URLComponentSource<char>* source, url_parse::Parsed* parsed); @@ -400,7 +400,7 @@ bool CanonicalizePartialPath(const char* spec, const url_parse::Component& path, int path_begin_in_output, CanonOutput* output); -bool CanonicalizePartialPath(const char16* spec, +bool CanonicalizePartialPath(const base::char16* spec, const url_parse::Component& path, int path_begin_in_output, CanonOutput* output); @@ -410,7 +410,7 @@ bool CanonicalizePartialPath(const char16* spec, // Implementations of Windows' int-to-string conversions URL_EXPORT int _itoa_s(int value, char* buffer, size_t size_in_chars, int radix); -URL_EXPORT int _itow_s(int value, char16* buffer, size_t size_in_chars, +URL_EXPORT int _itow_s(int value, base::char16* buffer, size_t size_in_chars, int radix); // Secure template overloads for these functions @@ -420,7 +420,7 @@ inline int _itoa_s(int value, char (&buffer)[N], int radix) { } template<size_t N> -inline int _itow_s(int value, char16 (&buffer)[N], int radix) { +inline int _itow_s(int value, base::char16 (&buffer)[N], int radix) { return _itow_s(value, buffer, N, radix); } diff --git a/url/url_canon_ip.cc b/url/url_canon_ip.cc index a6ee2424..f884c2e 100644 --- a/url/url_canon_ip.cc +++ b/url/url_canon_ip.cc @@ -645,10 +645,11 @@ bool FindIPv4Components(const char* spec, return DoFindIPv4Components<char, unsigned char>(spec, host, components); } -bool FindIPv4Components(const char16* spec, +bool FindIPv4Components(const base::char16* spec, const url_parse::Component& host, url_parse::Component components[4]) { - return DoFindIPv4Components<char16, char16>(spec, host, components); + return DoFindIPv4Components<base::char16, base::char16>( + spec, host, components); } void CanonicalizeIPAddress(const char* spec, @@ -663,14 +664,14 @@ void CanonicalizeIPAddress(const char* spec, return; } -void CanonicalizeIPAddress(const char16* spec, +void CanonicalizeIPAddress(const base::char16* spec, const url_parse::Component& host, CanonOutput* output, CanonHostInfo* host_info) { - if (DoCanonicalizeIPv4Address<char16, char16>( + if (DoCanonicalizeIPv4Address<base::char16, base::char16>( spec, host, output, host_info)) return; - if (DoCanonicalizeIPv6Address<char16, char16>( + if (DoCanonicalizeIPv6Address<base::char16, base::char16>( spec, host, output, host_info)) return; } @@ -682,11 +683,11 @@ CanonHostInfo::Family IPv4AddressToNumber(const char* spec, return DoIPv4AddressToNumber<char>(spec, host, address, num_ipv4_components); } -CanonHostInfo::Family IPv4AddressToNumber(const char16* spec, +CanonHostInfo::Family IPv4AddressToNumber(const base::char16* spec, const url_parse::Component& host, unsigned char address[4], int* num_ipv4_components) { - return DoIPv4AddressToNumber<char16>( + return DoIPv4AddressToNumber<base::char16>( spec, host, address, num_ipv4_components); } @@ -696,10 +697,10 @@ bool IPv6AddressToNumber(const char* spec, return DoIPv6AddressToNumber<char, unsigned char>(spec, host, address); } -bool IPv6AddressToNumber(const char16* spec, +bool IPv6AddressToNumber(const base::char16* spec, const url_parse::Component& host, unsigned char address[16]) { - return DoIPv6AddressToNumber<char16, char16>(spec, host, address); + return DoIPv6AddressToNumber<base::char16, base::char16>(spec, host, address); } } // namespace url_canon diff --git a/url/url_canon_ip.h b/url/url_canon_ip.h index fd288ad..d5560f0 100644 --- a/url/url_canon_ip.h +++ b/url/url_canon_ip.h @@ -41,7 +41,7 @@ URL_EXPORT void AppendIPv6Address(const unsigned char address[16], URL_EXPORT bool FindIPv4Components(const char* spec, const url_parse::Component& host, url_parse::Component components[4]); -URL_EXPORT bool FindIPv4Components(const char16* spec, +URL_EXPORT bool FindIPv4Components(const base::char16* spec, const url_parse::Component& host, url_parse::Component components[4]); @@ -62,7 +62,7 @@ URL_EXPORT CanonHostInfo::Family IPv4AddressToNumber( unsigned char address[4], int* num_ipv4_components); URL_EXPORT CanonHostInfo::Family IPv4AddressToNumber( - const char16* spec, + const base::char16* spec, const url_parse::Component& host, unsigned char address[4], int* num_ipv4_components); @@ -75,7 +75,7 @@ URL_EXPORT CanonHostInfo::Family IPv4AddressToNumber( URL_EXPORT bool IPv6AddressToNumber(const char* spec, const url_parse::Component& host, unsigned char address[16]); -URL_EXPORT bool IPv6AddressToNumber(const char16* spec, +URL_EXPORT bool IPv6AddressToNumber(const base::char16* spec, const url_parse::Component& host, unsigned char address[16]); diff --git a/url/url_canon_mailtourl.cc b/url/url_canon_mailtourl.cc index ef13ffa..7d9d18a 100644 --- a/url/url_canon_mailtourl.cc +++ b/url/url_canon_mailtourl.cc @@ -75,13 +75,13 @@ bool CanonicalizeMailtoURL(const char* spec, URLComponentSource<char>(spec), parsed, output, new_parsed); } -bool CanonicalizeMailtoURL(const char16* spec, +bool CanonicalizeMailtoURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CanonOutput* output, url_parse::Parsed* new_parsed) { - return DoCanonicalizeMailtoURL<char16, char16>( - URLComponentSource<char16>(spec), parsed, output, new_parsed); + return DoCanonicalizeMailtoURL<base::char16, base::char16>( + URLComponentSource<base::char16>(spec), parsed, output, new_parsed); } bool ReplaceMailtoURL(const char* base, @@ -98,7 +98,7 @@ bool ReplaceMailtoURL(const char* base, bool ReplaceMailtoURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CanonOutput* output, url_parse::Parsed* new_parsed) { RawCanonOutput<1024> utf8; diff --git a/url/url_canon_path.cc b/url/url_canon_path.cc index 6e34b3b..f42af68 100644 --- a/url/url_canon_path.cc +++ b/url/url_canon_path.cc @@ -326,11 +326,11 @@ bool CanonicalizePath(const char* spec, return DoPath<char, unsigned char>(spec, path, output, out_path); } -bool CanonicalizePath(const char16* spec, +bool CanonicalizePath(const base::char16* spec, const url_parse::Component& path, CanonOutput* output, url_parse::Component* out_path) { - return DoPath<char16, char16>(spec, path, output, out_path); + return DoPath<base::char16, base::char16>(spec, path, output, out_path); } bool CanonicalizePartialPath(const char* spec, @@ -341,12 +341,13 @@ bool CanonicalizePartialPath(const char* spec, output); } -bool CanonicalizePartialPath(const char16* spec, +bool CanonicalizePartialPath(const base::char16* spec, const url_parse::Component& path, int path_begin_in_output, CanonOutput* output) { - return DoPartialPath<char16, char16>(spec, path, path_begin_in_output, - output); + return DoPartialPath<base::char16, base::char16>(spec, path, + path_begin_in_output, + output); } } // namespace url_canon diff --git a/url/url_canon_pathurl.cc b/url/url_canon_pathurl.cc index 6419785..bc681f4 100644 --- a/url/url_canon_pathurl.cc +++ b/url/url_canon_pathurl.cc @@ -66,13 +66,13 @@ bool CanonicalizePathURL(const char* spec, URLComponentSource<char>(spec), parsed, output, new_parsed); } -bool CanonicalizePathURL(const char16* spec, +bool CanonicalizePathURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CanonOutput* output, url_parse::Parsed* new_parsed) { - return DoCanonicalizePathURL<char16, char16>( - URLComponentSource<char16>(spec), parsed, output, new_parsed); + return DoCanonicalizePathURL<base::char16, base::char16>( + URLComponentSource<base::char16>(spec), parsed, output, new_parsed); } bool ReplacePathURL(const char* base, @@ -89,7 +89,7 @@ bool ReplacePathURL(const char* base, bool ReplacePathURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CanonOutput* output, url_parse::Parsed* new_parsed) { RawCanonOutput<1024> utf8; diff --git a/url/url_canon_query.cc b/url/url_canon_query.cc index 3cdf9ae..b17a73b 100644 --- a/url/url_canon_query.cc +++ b/url/url_canon_query.cc @@ -82,7 +82,7 @@ void RunConverter(const char* spec, // Runs the converter with the given UTF-16 input. We don't have to do // anything, but this overriddden function allows us to use the same code // for both UTF-8 and UTF-16 input. -void RunConverter(const char16* spec, +void RunConverter(const base::char16* spec, const url_parse::Component& query, CharsetConverter* converter, CanonOutput* output) { @@ -144,21 +144,21 @@ void CanonicalizeQuery(const char* spec, output, out_query); } -void CanonicalizeQuery(const char16* spec, +void CanonicalizeQuery(const base::char16* spec, const url_parse::Component& query, CharsetConverter* converter, CanonOutput* output, url_parse::Component* out_query) { - DoCanonicalizeQuery<char16, char16>(spec, query, converter, - output, out_query); + DoCanonicalizeQuery<base::char16, base::char16>(spec, query, converter, + output, out_query); } -void ConvertUTF16ToQueryEncoding(const char16* input, +void ConvertUTF16ToQueryEncoding(const base::char16* input, const url_parse::Component& query, CharsetConverter* converter, CanonOutput* output) { - DoConvertToQueryEncoding<char16, char16>(input, query, - converter, output); + DoConvertToQueryEncoding<base::char16, base::char16>(input, query, + converter, output); } } // namespace url_canon diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc index 52ae169..30956a6 100644 --- a/url/url_canon_relative.cc +++ b/url/url_canon_relative.cc @@ -515,12 +515,12 @@ bool IsRelativeURL(const char* base, bool IsRelativeURL(const char* base, const url_parse::Parsed& base_parsed, - const char16* fragment, + const base::char16* fragment, int fragment_len, bool is_base_hierarchical, bool* is_relative, url_parse::Component* relative_component) { - return DoIsRelativeURL<char16>( + return DoIsRelativeURL<base::char16>( base, base_parsed, fragment, fragment_len, is_base_hierarchical, is_relative, relative_component); } @@ -541,12 +541,12 @@ bool ResolveRelativeURL(const char* base_url, bool ResolveRelativeURL(const char* base_url, const url_parse::Parsed& base_parsed, bool base_is_file, - const char16* relative_url, + const base::char16* relative_url, const url_parse::Component& relative_component, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* out_parsed) { - return DoResolveRelativeURL<char16>( + return DoResolveRelativeURL<base::char16>( base_url, base_parsed, base_is_file, relative_url, relative_component, query_converter, output, out_parsed); } diff --git a/url/url_canon_stdurl.cc b/url/url_canon_stdurl.cc index 66f5218..548dc99 100644 --- a/url/url_canon_stdurl.cc +++ b/url/url_canon_stdurl.cc @@ -134,14 +134,14 @@ bool CanonicalizeStandardURL(const char* spec, output, new_parsed); } -bool CanonicalizeStandardURL(const char16* spec, +bool CanonicalizeStandardURL(const base::char16* spec, int spec_len, const url_parse::Parsed& parsed, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { - return DoCanonicalizeStandardURL<char16, char16>( - URLComponentSource<char16>(spec), parsed, query_converter, + return DoCanonicalizeStandardURL<base::char16, base::char16>( + URLComponentSource<base::char16>(spec), parsed, query_converter, output, new_parsed); } @@ -171,7 +171,7 @@ bool ReplaceStandardURL(const char* base, // regular codepath can be used. bool ReplaceStandardURL(const char* base, const url_parse::Parsed& base_parsed, - const Replacements<char16>& replacements, + const Replacements<base::char16>& replacements, CharsetConverter* query_converter, CanonOutput* output, url_parse::Parsed* new_parsed) { diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc index a556d01..6f52d66 100644 --- a/url/url_canon_unittest.cc +++ b/url/url_canon_unittest.cc @@ -217,7 +217,7 @@ TEST(URLCanonTest, UTF) { out_str.clear(); url_canon::StdStringCanonOutput output(&out_str); - string16 input_str(WStringToUTF16(utf_cases[i].input16)); + base::string16 input_str(WStringToUTF16(utf_cases[i].input16)); int input_len = static_cast<int>(input_str.length()); bool success = true; for (int ch = 0; ch < input_len; ch++) { @@ -235,7 +235,7 @@ TEST(URLCanonTest, UTF) { // UTF-16 -> UTF-8 std::string input8_str(utf_cases[i].input8); - string16 input16_str(WStringToUTF16(utf_cases[i].input16)); + base::string16 input16_str(WStringToUTF16(utf_cases[i].input16)); EXPECT_EQ(input8_str, ConvertUTF16ToUTF8(input16_str)); // UTF-8 -> UTF-16 @@ -269,7 +269,7 @@ TEST(URLCanonTest, ICUCharsetConverter) { std::string str; url_canon::StdStringCanonOutput output(&str); - string16 input_str(WStringToUTF16(icu_cases[i].input)); + base::string16 input_str(WStringToUTF16(icu_cases[i].input)); int input_len = static_cast<int>(input_str.length()); converter.ConvertFromUTF16(input_str.c_str(), input_len, &output); output.Complete(); @@ -285,7 +285,7 @@ TEST(URLCanonTest, ICUCharsetConverter) { url_canon::ICUCharsetConverter converter(conv.converter()); for (int i = static_size - 2; i <= static_size + 2; i++) { // Make a string with the appropriate length. - string16 input; + base::string16 input; for (int ch = 0; ch < i; ch++) input.push_back('a'); @@ -338,7 +338,7 @@ TEST(URLCanonTest, Scheme) { out_str.clear(); url_canon::StdStringCanonOutput output2(&out_str); - string16 wide_input(ConvertUTF8ToUTF16(scheme_cases[i].input)); + base::string16 wide_input(ConvertUTF8ToUTF16(scheme_cases[i].input)); in_comp.len = static_cast<int>(wide_input.length()); success = url_canon::CanonicalizeScheme(wide_input.c_str(), in_comp, &output2, &out_comp); @@ -461,7 +461,7 @@ TEST(URLCanonTest, Host) { // Wide version. if (host_cases[i].input16) { - string16 input16(WStringToUTF16(host_cases[i].input16)); + base::string16 input16(WStringToUTF16(host_cases[i].input16)); int host_len = static_cast<int>(input16.length()); url_parse::Component in_comp(0, host_len); url_parse::Component out_comp; @@ -511,7 +511,7 @@ TEST(URLCanonTest, Host) { // Wide version. if (host_cases[i].input16) { - string16 input16(WStringToUTF16(host_cases[i].input16)); + base::string16 input16(WStringToUTF16(host_cases[i].input16)); int host_len = static_cast<int>(input16.length()); url_parse::Component in_comp(0, host_len); @@ -636,7 +636,7 @@ TEST(URLCanonTest, IPv4) { } // 16-bit version. - string16 input16(WStringToUTF16(cases[i].input16)); + base::string16 input16(WStringToUTF16(cases[i].input16)); component = url_parse::Component(0, static_cast<int>(input16.length())); std::string out_str2; @@ -790,7 +790,7 @@ TEST(URLCanonTest, IPv6) { } // 16-bit version. - string16 input16(WStringToUTF16(cases[i].input16)); + base::string16 input16(WStringToUTF16(cases[i].input16)); component = url_parse::Component(0, static_cast<int>(input16.length())); std::string out_str2; @@ -878,7 +878,7 @@ TEST(URLCanonTest, UserInfo) { // Now try the wide version out_str.clear(); url_canon::StdStringCanonOutput output2(&out_str); - string16 wide_input(ConvertUTF8ToUTF16(user_info_cases[i].input)); + base::string16 wide_input(ConvertUTF8ToUTF16(user_info_cases[i].input)); success = url_canon::CanonicalizeUserInfo(wide_input.c_str(), parsed.username, wide_input.c_str(), @@ -937,7 +937,7 @@ TEST(URLCanonTest, Port) { // Now try the wide version out_str.clear(); url_canon::StdStringCanonOutput output2(&out_str); - string16 wide_input(ConvertUTF8ToUTF16(port_cases[i].input)); + base::string16 wide_input(ConvertUTF8ToUTF16(port_cases[i].input)); success = url_canon::CanonicalizePort(wide_input.c_str(), in_comp, port_cases[i].default_port, &output2, &out_comp); @@ -1040,7 +1040,7 @@ TEST(URLCanonTest, Path) { } if (path_cases[i].input16) { - string16 input16(WStringToUTF16(path_cases[i].input16)); + base::string16 input16(WStringToUTF16(path_cases[i].input16)); int len = static_cast<int>(input16.length()); url_parse::Component in_comp(0, len); url_parse::Component out_comp; @@ -1135,7 +1135,7 @@ TEST(URLCanonTest, Query) { } if (query_cases[i].input16) { - string16 input16(WStringToUTF16(query_cases[i].input16)); + base::string16 input16(WStringToUTF16(query_cases[i].input16)); int len = static_cast<int>(input16.length()); url_parse::Component in_comp(0, len); std::string out_str; @@ -1200,7 +1200,7 @@ TEST(URLCanonTest, Ref) { // 16-bit input if (ref_cases[i].input16) { - string16 input16(WStringToUTF16(ref_cases[i].input16)); + base::string16 input16(WStringToUTF16(ref_cases[i].input16)); int len = static_cast<int>(input16.length()); url_parse::Component in_comp(0, len); url_parse::Component out_comp; @@ -1833,17 +1833,17 @@ TEST(URLCanonTest, _itow_s) { // We fill the buffer with 0xff to ensure that it's getting properly // null-terminated. We also allocate one byte more than what we tell // _itoa_s about, and ensure that the extra byte is untouched. - char16 buf[6]; + base::char16 buf[6]; const char fill_mem = 0xff; - const char16 fill_char = 0xffff; + const base::char16 fill_char = 0xffff; memset(buf, fill_mem, sizeof(buf)); EXPECT_EQ(0, url_canon::_itow_s(12, buf, sizeof(buf) / 2 - 1, 10)); - EXPECT_EQ(WStringToUTF16(L"12"), string16(buf)); + EXPECT_EQ(WStringToUTF16(L"12"), base::string16(buf)); EXPECT_EQ(fill_char, buf[3]); // Test the edge cases - exactly the buffer size and one over EXPECT_EQ(0, url_canon::_itow_s(1234, buf, sizeof(buf) / 2 - 1, 10)); - EXPECT_EQ(WStringToUTF16(L"1234"), string16(buf)); + EXPECT_EQ(WStringToUTF16(L"1234"), base::string16(buf)); EXPECT_EQ(fill_char, buf[5]); memset(buf, fill_mem, sizeof(buf)); @@ -1853,12 +1853,12 @@ TEST(URLCanonTest, _itow_s) { // Test the template overload (note that this will see the full buffer) memset(buf, fill_mem, sizeof(buf)); EXPECT_EQ(0, url_canon::_itow_s(12, buf, 10)); - EXPECT_EQ(WStringToUTF16(L"12"), string16(buf)); + EXPECT_EQ(WStringToUTF16(L"12"), base::string16(buf)); EXPECT_EQ(fill_char, buf[3]); memset(buf, fill_mem, sizeof(buf)); EXPECT_EQ(0, url_canon::_itow_s(12345, buf, 10)); - EXPECT_EQ(WStringToUTF16(L"12345"), string16(buf)); + EXPECT_EQ(WStringToUTF16(L"12345"), base::string16(buf)); EXPECT_EQ(EINVAL, url_canon::_itow_s(123456, buf, 10)); } @@ -2081,12 +2081,12 @@ TEST(URLCanonTest, ReplacementOverflow) { // Override two components, the path with something short, and the query with // sonething long enough to trigger the bug. - url_canon::Replacements<char16> repl; - string16 new_query; + url_canon::Replacements<base::char16> repl; + base::string16 new_query; for (int i = 0; i < 4800; i++) new_query.push_back('a'); - string16 new_path(WStringToUTF16(L"/foo")); + base::string16 new_path(WStringToUTF16(L"/foo")); repl.SetPath(new_path.c_str(), url_parse::Component(0, 4)); repl.SetQuery(new_query.c_str(), url_parse::Component(0, static_cast<int>(new_query.length()))); diff --git a/url/url_file.h b/url/url_file.h index 085bb9a..f81c21f 100644 --- a/url/url_file.h +++ b/url/url_file.h @@ -15,10 +15,10 @@ namespace url_parse { #ifdef WIN32 // We allow both "c:" and "c|" as drive identifiers. -inline bool IsWindowsDriveSeparator(char16 ch) { +inline bool IsWindowsDriveSeparator(base::char16 ch) { return ch == ':' || ch == '|'; } -inline bool IsWindowsDriveLetter(char16 ch) { +inline bool IsWindowsDriveLetter(base::char16 ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } diff --git a/url/url_parse.cc b/url/url_parse.cc index 6b6af44..0d9c6dd1c 100644 --- a/url/url_parse.cc +++ b/url/url_parse.cc @@ -48,7 +48,7 @@ namespace url_parse { namespace { // Returns true if the given character is a valid digit to use in a port. -inline bool IsPortDigit(char16 ch) { +inline bool IsPortDigit(base::char16 ch) { return ch >= '0' && ch <= '9'; } @@ -796,13 +796,13 @@ bool ExtractScheme(const char* url, int url_len, Component* scheme) { return DoExtractScheme(url, url_len, scheme); } -bool ExtractScheme(const char16* url, int url_len, Component* scheme) { +bool ExtractScheme(const base::char16* url, int url_len, Component* scheme) { return DoExtractScheme(url, url_len, scheme); } // This handles everything that may be an authority terminator, including // backslash. For special backslash handling see DoParseAfterScheme. -bool IsAuthorityTerminator(char16 ch) { +bool IsAuthorityTerminator(base::char16 ch) { return IsURLSlash(ch) || ch == '?' || ch == '#'; } @@ -812,7 +812,7 @@ void ExtractFileName(const char* url, DoExtractFileName(url, path, file_name); } -void ExtractFileName(const char16* url, +void ExtractFileName(const base::char16* url, const Component& path, Component* file_name) { DoExtractFileName(url, path, file_name); @@ -825,7 +825,7 @@ bool ExtractQueryKeyValue(const char* url, return DoExtractQueryKeyValue(url, query, key, value); } -bool ExtractQueryKeyValue(const char16* url, +bool ExtractQueryKeyValue(const base::char16* url, Component* query, Component* key, Component* value) { @@ -841,7 +841,7 @@ void ParseAuthority(const char* spec, DoParseAuthority(spec, auth, username, password, hostname, port_num); } -void ParseAuthority(const char16* spec, +void ParseAuthority(const base::char16* spec, const Component& auth, Component* username, Component* password, @@ -854,7 +854,7 @@ int ParsePort(const char* url, const Component& port) { return DoParsePort(url, port); } -int ParsePort(const char16* url, const Component& port) { +int ParsePort(const base::char16* url, const Component& port) { return DoParsePort(url, port); } @@ -862,7 +862,7 @@ void ParseStandardURL(const char* url, int url_len, Parsed* parsed) { DoParseStandardURL(url, url_len, parsed); } -void ParseStandardURL(const char16* url, int url_len, Parsed* parsed) { +void ParseStandardURL(const base::char16* url, int url_len, Parsed* parsed) { DoParseStandardURL(url, url_len, parsed); } @@ -870,7 +870,7 @@ void ParsePathURL(const char* url, int url_len, Parsed* parsed) { DoParsePathURL(url, url_len, parsed); } -void ParsePathURL(const char16* url, int url_len, Parsed* parsed) { +void ParsePathURL(const base::char16* url, int url_len, Parsed* parsed) { DoParsePathURL(url, url_len, parsed); } @@ -878,7 +878,7 @@ void ParseFileSystemURL(const char* url, int url_len, Parsed* parsed) { DoParseFileSystemURL(url, url_len, parsed); } -void ParseFileSystemURL(const char16* url, int url_len, Parsed* parsed) { +void ParseFileSystemURL(const base::char16* url, int url_len, Parsed* parsed) { DoParseFileSystemURL(url, url_len, parsed); } @@ -886,7 +886,7 @@ void ParseMailtoURL(const char* url, int url_len, Parsed* parsed) { DoParseMailtoURL(url, url_len, parsed); } -void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed) { +void ParseMailtoURL(const base::char16* url, int url_len, Parsed* parsed) { DoParseMailtoURL(url, url_len, parsed); } @@ -898,7 +898,7 @@ void ParsePathInternal(const char* spec, ParsePath(spec, path, filepath, query, ref); } -void ParsePathInternal(const char16* spec, +void ParsePathInternal(const base::char16* spec, const Component& path, Component* filepath, Component* query, @@ -913,7 +913,7 @@ void ParseAfterScheme(const char* spec, DoParseAfterScheme(spec, spec_len, after_scheme, parsed); } -void ParseAfterScheme(const char16* spec, +void ParseAfterScheme(const base::char16* spec, int spec_len, int after_scheme, Parsed* parsed) { diff --git a/url/url_parse.h b/url/url_parse.h index 2170904..4ab9e69 100644 --- a/url/url_parse.h +++ b/url/url_parse.h @@ -15,7 +15,7 @@ namespace url_parse { // Deprecated, but WebKit/WebCore/platform/KURLGooglePrivate.h and // KURLGoogle.cpp still rely on this type. -typedef char16 UTF16Char; +typedef base::char16 UTF16Char; // Component ------------------------------------------------------------------ @@ -223,7 +223,7 @@ struct URL_EXPORT Parsed { URL_EXPORT void ParseStandardURL(const char* url, int url_len, Parsed* parsed); -URL_EXPORT void ParseStandardURL(const char16* url, +URL_EXPORT void ParseStandardURL(const base::char16* url, int url_len, Parsed* parsed); @@ -232,24 +232,30 @@ URL_EXPORT void ParseStandardURL(const char16* url, // everything after the scheme is considered as the path. This is used for // things like "about:" and "javascript:" URL_EXPORT void ParsePathURL(const char* url, int url_len, Parsed* parsed); -URL_EXPORT void ParsePathURL(const char16* url, int url_len, Parsed* parsed); +URL_EXPORT void ParsePathURL(const base::char16* url, + int url_len, + Parsed* parsed); // FileURL is for file URLs. There are some special rules for interpreting // these. URL_EXPORT void ParseFileURL(const char* url, int url_len, Parsed* parsed); -URL_EXPORT void ParseFileURL(const char16* url, int url_len, Parsed* parsed); +URL_EXPORT void ParseFileURL(const base::char16* url, + int url_len, + Parsed* parsed); // Filesystem URLs are structured differently than other URLs. URL_EXPORT void ParseFileSystemURL(const char* url, int url_len, Parsed* parsed); -URL_EXPORT void ParseFileSystemURL(const char16* url, +URL_EXPORT void ParseFileSystemURL(const base::char16* url, int url_len, Parsed* parsed); // MailtoURL is for mailto: urls. They are made up scheme,path,query URL_EXPORT void ParseMailtoURL(const char* url, int url_len, Parsed* parsed); -URL_EXPORT void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed); +URL_EXPORT void ParseMailtoURL(const base::char16* url, + int url_len, + Parsed* parsed); // Helper functions ----------------------------------------------------------- @@ -276,13 +282,13 @@ URL_EXPORT void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed); URL_EXPORT bool ExtractScheme(const char* url, int url_len, Component* scheme); -URL_EXPORT bool ExtractScheme(const char16* url, +URL_EXPORT bool ExtractScheme(const base::char16* url, int url_len, Component* scheme); // Returns true if ch is a character that terminates the authority segment // of a URL. -URL_EXPORT bool IsAuthorityTerminator(char16 ch); +URL_EXPORT bool IsAuthorityTerminator(base::char16 ch); // Does a best effort parse of input |spec|, in range |auth|. If a particular // component is not found, it will be set to invalid. @@ -292,7 +298,7 @@ URL_EXPORT void ParseAuthority(const char* spec, Component* password, Component* hostname, Component* port_num); -URL_EXPORT void ParseAuthority(const char16* spec, +URL_EXPORT void ParseAuthority(const base::char16* spec, const Component& auth, Component* username, Component* password, @@ -307,7 +313,7 @@ URL_EXPORT void ParseAuthority(const char16* spec, // the two special values below. enum SpecialPort { PORT_UNSPECIFIED = -1, PORT_INVALID = -2 }; URL_EXPORT int ParsePort(const char* url, const Component& port); -URL_EXPORT int ParsePort(const char16* url, const Component& port); +URL_EXPORT int ParsePort(const base::char16* url, const Component& port); // Extracts the range of the file name in the given url. The path must // already have been computed by the parse function, and the matching URL @@ -322,7 +328,7 @@ URL_EXPORT int ParsePort(const char16* url, const Component& port); URL_EXPORT void ExtractFileName(const char* url, const Component& path, Component* file_name); -URL_EXPORT void ExtractFileName(const char16* url, +URL_EXPORT void ExtractFileName(const base::char16* url, const Component& path, Component* file_name); @@ -345,7 +351,7 @@ URL_EXPORT bool ExtractQueryKeyValue(const char* url, Component* query, Component* key, Component* value); -URL_EXPORT bool ExtractQueryKeyValue(const char16* url, +URL_EXPORT bool ExtractQueryKeyValue(const base::char16* url, Component* query, Component* key, Component* value); diff --git a/url/url_parse_file.cc b/url/url_parse_file.cc index b963102..a8907e7 100644 --- a/url/url_parse_file.cc +++ b/url/url_parse_file.cc @@ -211,7 +211,7 @@ void ParseFileURL(const char* url, int url_len, Parsed* parsed) { DoParseFileURL(url, url_len, parsed); } -void ParseFileURL(const char16* url, int url_len, Parsed* parsed) { +void ParseFileURL(const base::char16* url, int url_len, Parsed* parsed) { DoParseFileURL(url, url_len, parsed); } diff --git a/url/url_parse_internal.h b/url/url_parse_internal.h index 35b46ac..9c2b2b6 100644 --- a/url/url_parse_internal.h +++ b/url/url_parse_internal.h @@ -12,13 +12,13 @@ namespace url_parse { // We treat slashes and backslashes the same for IE compatability. -inline bool IsURLSlash(char16 ch) { +inline bool IsURLSlash(base::char16 ch) { return ch == '/' || ch == '\\'; } // Returns true if we should trim this character from the URL because it is a // space or a control character. -inline bool ShouldTrimFromURL(char16 ch) { +inline bool ShouldTrimFromURL(base::char16 ch) { return ch <= ' '; } @@ -63,7 +63,7 @@ void ParsePathInternal(const char* spec, Component* filepath, Component* query, Component* ref); -void ParsePathInternal(const char16* spec, +void ParsePathInternal(const base::char16* spec, const Component& path, Component* filepath, Component* query, @@ -77,7 +77,7 @@ void ParseAfterScheme(const char* spec, int spec_len, int after_scheme, Parsed* parsed); -void ParseAfterScheme(const char16* spec, +void ParseAfterScheme(const base::char16* spec, int spec_len, int after_scheme, Parsed* parsed); diff --git a/url/url_test_utils.h b/url/url_test_utils.h index 6ddcde0..3dea832 100644 --- a/url/url_test_utils.h +++ b/url/url_test_utils.h @@ -19,8 +19,8 @@ namespace url_test_utils { // Converts a UTF-16 string from native wchar_t format to char16, by // truncating the high 32 bits. This is not meant to handle true UTF-32 // encoded strings. -inline string16 WStringToUTF16(const wchar_t* src) { - string16 str; +inline base::string16 WStringToUTF16(const wchar_t* src) { + base::string16 str; int length = static_cast<int>(wcslen(src)); for (int i = 0; i < length; ++i) { str.push_back(static_cast<char16>(src[i])); @@ -29,16 +29,16 @@ inline string16 WStringToUTF16(const wchar_t* src) { } // Converts a string from UTF-8 to UTF-16 -inline string16 ConvertUTF8ToUTF16(const std::string& src) { +inline base::string16 ConvertUTF8ToUTF16(const std::string& src) { int length = static_cast<int>(src.length()); EXPECT_LT(length, 1024); url_canon::RawCanonOutputW<1024> output; EXPECT_TRUE(url_canon::ConvertUTF8ToUTF16(src.data(), length, &output)); - return string16(output.data(), output.length()); + return base::string16(output.data(), output.length()); } // Converts a string from UTF-16 to UTF-8 -inline std::string ConvertUTF16ToUTF8(const string16& src) { +inline std::string ConvertUTF16ToUTF8(const base::string16& src) { std::string str; url_canon::StdStringCanonOutput output(&str); EXPECT_TRUE(url_canon::ConvertUTF16ToUTF8(src.data(), diff --git a/url/url_util.cc b/url/url_util.cc index 33e3465..f16af98 100644 --- a/url/url_util.cc +++ b/url/url_util.cc @@ -409,7 +409,7 @@ bool IsStandard(const char* spec, const url_parse::Component& scheme) { return DoIsStandard(spec, scheme); } -bool IsStandard(const char16* spec, const url_parse::Component& scheme) { +bool IsStandard(const base::char16* spec, const url_parse::Component& scheme) { return DoIsStandard(spec, scheme); } @@ -420,7 +420,7 @@ bool FindAndCompareScheme(const char* str, return DoFindAndCompareScheme(str, str_len, compare, found_scheme); } -bool FindAndCompareScheme(const char16* str, +bool FindAndCompareScheme(const base::char16* str, int str_len, const char* compare, url_parse::Component* found_scheme) { @@ -436,7 +436,7 @@ bool Canonicalize(const char* spec, output, output_parsed); } -bool Canonicalize(const char16* spec, +bool Canonicalize(const base::char16* spec, int spec_len, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, @@ -461,7 +461,7 @@ bool ResolveRelative(const char* base_spec, bool ResolveRelative(const char* base_spec, int base_spec_len, const url_parse::Parsed& base_parsed, - const char16* relative, + const base::char16* relative, int relative_length, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, @@ -482,13 +482,14 @@ bool ReplaceComponents(const char* spec, charset_converter, output, out_parsed); } -bool ReplaceComponents(const char* spec, - int spec_len, - const url_parse::Parsed& parsed, - const url_canon::Replacements<char16>& replacements, - url_canon::CharsetConverter* charset_converter, - url_canon::CanonOutput* output, - url_parse::Parsed* out_parsed) { +bool ReplaceComponents( + const char* spec, + int spec_len, + const url_parse::Parsed& parsed, + const url_canon::Replacements<base::char16>& replacements, + url_canon::CharsetConverter* charset_converter, + url_canon::CanonOutput* output, + url_parse::Parsed* out_parsed) { return DoReplaceComponents(spec, spec_len, parsed, replacements, charset_converter, output, out_parsed); } @@ -512,8 +513,8 @@ bool LowerCaseEqualsASCII(const char* a_begin, return a_begin == a_end && b_begin == b_end; } -bool LowerCaseEqualsASCII(const char16* a_begin, - const char16* a_end, +bool LowerCaseEqualsASCII(const base::char16* a_begin, + const base::char16* a_end, const char* b) { return DoLowerCaseEqualsASCII(a_begin, a_end, b); } @@ -584,7 +585,7 @@ bool CompareSchemeComponent(const char* spec, return DoCompareSchemeComponent(spec, component, compare_to); } -bool CompareSchemeComponent(const char16* spec, +bool CompareSchemeComponent(const base::char16* spec, const url_parse::Component& component, const char* compare_to) { return DoCompareSchemeComponent(spec, component, compare_to); diff --git a/url/url_util.h b/url/url_util.h index a5f5176..995aa9b 100644 --- a/url/url_util.h +++ b/url/url_util.h @@ -67,7 +67,7 @@ URL_EXPORT bool FindAndCompareScheme(const char* str, int str_len, const char* compare, url_parse::Component* found_scheme); -URL_EXPORT bool FindAndCompareScheme(const char16* str, +URL_EXPORT bool FindAndCompareScheme(const base::char16* str, int str_len, const char* compare, url_parse::Component* found_scheme); @@ -77,7 +77,7 @@ inline bool FindAndCompareScheme(const std::string& str, return FindAndCompareScheme(str.data(), static_cast<int>(str.size()), compare, found_scheme); } -inline bool FindAndCompareScheme(const string16& str, +inline bool FindAndCompareScheme(const base::string16& str, const char* compare, url_parse::Component* found_scheme) { return FindAndCompareScheme(str.data(), static_cast<int>(str.size()), @@ -88,7 +88,7 @@ inline bool FindAndCompareScheme(const string16& str, // either the scheme is in the list of known standard schemes. URL_EXPORT bool IsStandard(const char* spec, const url_parse::Component& scheme); -URL_EXPORT bool IsStandard(const char16* spec, +URL_EXPORT bool IsStandard(const base::char16* spec, const url_parse::Component& scheme); // TODO(brettw) remove this. This is a temporary compatibility hack to avoid @@ -115,7 +115,7 @@ URL_EXPORT bool Canonicalize(const char* spec, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, url_parse::Parsed* output_parsed); -URL_EXPORT bool Canonicalize(const char16* spec, +URL_EXPORT bool Canonicalize(const base::char16* spec, int spec_len, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, @@ -142,7 +142,7 @@ URL_EXPORT bool ResolveRelative(const char* base_spec, URL_EXPORT bool ResolveRelative(const char* base_spec, int base_spec_len, const url_parse::Parsed& base_parsed, - const char16* relative, + const base::char16* relative, int relative_length, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, @@ -164,7 +164,7 @@ URL_EXPORT bool ReplaceComponents( const char* spec, int spec_len, const url_parse::Parsed& parsed, - const url_canon::Replacements<char16>& replacements, + const url_canon::Replacements<base::char16>& replacements, url_canon::CharsetConverter* charset_converter, url_canon::CanonOutput* output, url_parse::Parsed* out_parsed); @@ -184,8 +184,8 @@ URL_EXPORT bool LowerCaseEqualsASCII(const char* a_begin, const char* a_end, const char* b_begin, const char* b_end); -URL_EXPORT bool LowerCaseEqualsASCII(const char16* a_begin, - const char16* a_end, +URL_EXPORT bool LowerCaseEqualsASCII(const base::char16* a_begin, + const base::char16* a_end, const char* b); // Unescapes the given string using URL escaping rules. diff --git a/url/url_util_internal.h b/url/url_util_internal.h index a7c8fa5..74a2000 100644 --- a/url/url_util_internal.h +++ b/url/url_util_internal.h @@ -21,7 +21,7 @@ extern const char kMailtoScheme[]; bool CompareSchemeComponent(const char* spec, const url_parse::Component& component, const char* compare_to); -bool CompareSchemeComponent(const char16* spec, +bool CompareSchemeComponent(const base::char16* spec, const url_parse::Component& component, const char* compare_to); diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc index 76b7956..26d4dc7 100644 --- a/url/url_util_unittest.cc +++ b/url/url_util_unittest.cc @@ -165,30 +165,30 @@ TEST(URLUtilTest, DecodeURLEscapeSequences) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(decode_cases); i++) { const char* input = decode_cases[i].input; - url_canon::RawCanonOutputT<char16> output; + url_canon::RawCanonOutputT<base::char16> output; url_util::DecodeURLEscapeSequences(input, strlen(input), &output); EXPECT_EQ(decode_cases[i].output, url_test_utils::ConvertUTF16ToUTF8( - string16(output.data(), output.length()))); + base::string16(output.data(), output.length()))); } // Our decode should decode %00 const char zero_input[] = "%00"; - url_canon::RawCanonOutputT<char16> zero_output; + url_canon::RawCanonOutputT<base::char16> zero_output; url_util::DecodeURLEscapeSequences(zero_input, strlen(zero_input), &zero_output); EXPECT_NE("%00", url_test_utils::ConvertUTF16ToUTF8( - string16(zero_output.data(), zero_output.length()))); + base::string16(zero_output.data(), zero_output.length()))); // Test the error behavior for invalid UTF-8. const char invalid_input[] = "%e4%a0%e5%a5%bd"; - const char16 invalid_expected[4] = {0x00e4, 0x00a0, 0x597d, 0}; - url_canon::RawCanonOutputT<char16> invalid_output; + const base::char16 invalid_expected[4] = {0x00e4, 0x00a0, 0x597d, 0}; + url_canon::RawCanonOutputT<base::char16> invalid_output; url_util::DecodeURLEscapeSequences(invalid_input, strlen(invalid_input), &invalid_output); - EXPECT_EQ(string16(invalid_expected), - string16(invalid_output.data(), invalid_output.length())); + EXPECT_EQ(base::string16(invalid_expected), + base::string16(invalid_output.data(), invalid_output.length())); } TEST(URLUtilTest, TestEncodeURIComponent) { |