diff options
Diffstat (limited to 'chrome')
23 files changed, 45 insertions, 45 deletions
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index c5f62a8..7e64169 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -337,7 +337,7 @@ void InitializeUserDataDir() { std::string user_data_dir_string; scoped_ptr<base::Environment> environment(base::Environment::Create()); if (environment->GetVar("CHROME_USER_DATA_DIR", &user_data_dir_string) && - IsStringUTF8(user_data_dir_string)) { + base::IsStringUTF8(user_data_dir_string)) { user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string); } } diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index 05cd36a..a5ae06b 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -464,7 +464,7 @@ void BookmarkCodec::UpdateChecksum(const base::string16& str) { void BookmarkCodec::UpdateChecksumWithUrlNode(const std::string& id, const base::string16& title, const std::string& url) { - DCHECK(IsStringUTF8(url)); + DCHECK(base::IsStringUTF8(url)); UpdateChecksum(id); UpdateChecksum(title); UpdateChecksum(kTypeURL); diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc index c0cbd9c..4ed6bab 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc @@ -207,7 +207,7 @@ class Writer : public base::RefCountedThreadSafe<Writer> { // Writes out the text string (as UTF8). The text is escaped based on // type. bool Write(const std::string& text, TextType type) { - DCHECK(IsStringUTF8(text)); + DCHECK(base::IsStringUTF8(text)); std::string utf8_string; switch (type) { diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc index f8ca3b3..f2d4a46 100644 --- a/chrome/browser/chromeos/drive/file_system_util.cc +++ b/chrome/browser/chromeos/drive/file_system_util.cc @@ -299,7 +299,7 @@ std::string UnescapeCacheFileName(const std::string& filename) { } std::string NormalizeFileName(const std::string& input) { - DCHECK(IsStringUTF8(input)); + DCHECK(base::IsStringUTF8(input)); std::string output; if (!base::ConvertToUtf8AndNormalize(input, base::kCodepageUTF8, &output)) diff --git a/chrome/browser/chromeos/system/syslogs_provider.cc b/chrome/browser/chromeos/system/syslogs_provider.cc index b30212b..92feef7 100644 --- a/chrome/browser/chromeos/system/syslogs_provider.cc +++ b/chrome/browser/chromeos/system/syslogs_provider.cc @@ -158,7 +158,7 @@ LogDictionaryType* GetSystemLogs(base::FilePath* zip_file_name, base::TrimWhitespaceASCII(key, base::TRIM_ALL, &key); if (!key.empty()) { std::string value = ReadValue(&data); - if (IsStringUTF8(value)) { + if (base::IsStringUTF8(value)) { base::TrimWhitespaceASCII(value, base::TRIM_ALL, &value); if (value.empty()) (*logs)[key] = kEmptyLogEntry; diff --git a/chrome/browser/download/download_extensions.cc b/chrome/browser/download/download_extensions.cc index 4d36aa0..75ebb01 100644 --- a/chrome/browser/download/download_extensions.cc +++ b/chrome/browser/download/download_extensions.cc @@ -209,7 +209,7 @@ DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { base::FilePath::StringType extension(path.FinalExtension()); if (extension.empty()) return NOT_DANGEROUS; - if (!IsStringASCII(extension)) + if (!base::IsStringASCII(extension)) return NOT_DANGEROUS; #if defined(OS_WIN) std::string ascii_extension = base::UTF16ToASCII(extension); diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc index 750bd1e..c29a938 100644 --- a/chrome/browser/extensions/api/cookies/cookies_helpers.cc +++ b/chrome/browser/extensions/api/cookies/cookies_helpers.cc @@ -76,8 +76,8 @@ scoped_ptr<Cookie> CreateCookie( cookie->host_only = net::cookie_util::DomainIsHostOnly( canonical_cookie.Domain()); // A non-UTF8 path is invalid, so we just replace it with an empty string. - cookie->path = IsStringUTF8(canonical_cookie.Path()) ? canonical_cookie.Path() - : std::string(); + cookie->path = base::IsStringUTF8(canonical_cookie.Path()) + ? canonical_cookie.Path() : std::string(); cookie->secure = canonical_cookie.IsSecure(); cookie->http_only = canonical_cookie.IsHttpOnly(); cookie->session = !canonical_cookie.IsPersistent(); diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc index e7c1174..64a4282 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc @@ -112,7 +112,7 @@ bool GetPacUrlFromExtensionPref(const base::DictionaryValue* proxy_config, *bad_message = true; return false; } - if (!IsStringASCII(pac_url16)) { + if (!base::IsStringASCII(pac_url16)) { *error = "'pacScript.url' supports only ASCII URLs " "(encode URLs in Punycode format)."; return false; @@ -137,7 +137,7 @@ bool GetPacDataFromExtensionPref(const base::DictionaryValue* proxy_config, *bad_message = true; return false; } - if (!IsStringASCII(pac_data16)) { + if (!base::IsStringASCII(pac_data16)) { *error = "'pacScript.data' supports only ASCII code" "(encode URLs in Punycode format)."; return false; @@ -169,7 +169,7 @@ bool GetProxyServer(const base::DictionaryValue* proxy_server, *bad_message = true; return false; } - if (!IsStringASCII(host16)) { + if (!base::IsStringASCII(host16)) { *error = ErrorUtils::FormatErrorMessage( "Invalid 'rules.???.host' entry '*'. 'host' field supports only ASCII " "URLs (encode URLs in Punycode format).", @@ -272,7 +272,7 @@ bool JoinUrlList(const base::ListValue* list, *bad_message = true; return false; } - if (!IsStringASCII(entry)) { + if (!base::IsStringASCII(entry)) { *error = "'rules.bypassList' supports only ASCII URLs " "(encode URLs in Punycode format)."; return false; diff --git a/chrome/browser/extensions/api/serial/serial_connection.cc b/chrome/browser/extensions/api/serial/serial_connection.cc index 281cdda..64772f3 100644 --- a/chrome/browser/extensions/api/serial/serial_connection.cc +++ b/chrome/browser/extensions/api/serial/serial_connection.cc @@ -168,7 +168,7 @@ void SerialConnection::StartOpen() { // It's the responsibility of the API wrapper around SerialConnection to // validate the supplied path against the set of valid port names, and // it is a reasonable assumption that serial port names are ASCII. - DCHECK(IsStringASCII(port_)); + DCHECK(base::IsStringASCII(port_)); base::FilePath path( base::FilePath::FromUTF8Unsafe(MaybeFixUpPortName(port_))); int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ | diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index dc884f8..4118a55 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -302,7 +302,7 @@ base::DictionaryValue* ToHeaderDictionary(const std::string& name, const std::string& value) { base::DictionaryValue* header = new base::DictionaryValue(); header->SetString(keys::kHeaderNameKey, name); - if (IsStringUTF8(value)) { + if (base::IsStringUTF8(value)) { header->SetString(keys::kHeaderValueKey, value); } else { header->Set(keys::kHeaderBinaryValueKey, diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc index 933bcc5..3086cac 100644 --- a/chrome/browser/extensions/convert_user_script.cc +++ b/chrome/browser/extensions/convert_user_script.cc @@ -39,7 +39,7 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( return NULL; } - if (!IsStringUTF8(content)) { + if (!base::IsStringUTF8(content)) { *error = base::ASCIIToUTF16("User script must be UTF8 encoded."); return NULL; } diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index e3e9865..cad8fda 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -164,7 +164,7 @@ class URLRequestResourceBundleJob : public net::URLRequestSimpleJob { if (StartsWithASCII(*read_mime_type, "text/", false)) { // All of our HTML files should be UTF-8 and for other resource types // (like images), charset doesn't matter. - DCHECK(IsStringUTF8(*data)); + DCHECK(base::IsStringUTF8(*data)); *charset = "utf-8"; } int result = read_result ? net::OK : net::ERR_INVALID_URL; diff --git a/chrome/browser/internal_auth.cc b/chrome/browser/internal_auth.cc index 984c954..acdd442 100644 --- a/chrome/browser/internal_auth.cc +++ b/chrome/browser/internal_auth.cc @@ -89,7 +89,7 @@ int64 GetCurrentTick() { bool IsDomainSane(const std::string& domain) { return !domain.empty() && domain.size() <= kStringLengthLimit && - IsStringUTF8(domain) && + base::IsStringUTF8(domain) && domain.find_first_of(kItemSeparator) == std::string::npos; } @@ -109,14 +109,14 @@ bool IsVarSane(const std::string& var) { kVarValueSeparator) == kAllowedChars + arraysize(kAllowedChars)); return !var.empty() && var.size() <= kStringLengthLimit && - IsStringASCII(var) && + base::IsStringASCII(var) && var.find_first_not_of(kAllowedChars) == std::string::npos && !IsAsciiDigit(var[0]); } bool IsValueSane(const std::string& value) { return value.size() <= kStringLengthLimit && - IsStringUTF8(value) && + base::IsStringUTF8(value) && value.find_first_of(kItemSeparator) == std::string::npos; } @@ -265,7 +265,7 @@ class InternalAuthVerificationService { const std::string& domain, int64 current_tick) { if (passport.size() != kPassportSize || - !IsStringASCII(passport) || + !base::IsStringASCII(passport) || !IsDomainSane(domain) || current_tick <= dark_tick_ || current_tick > key_change_tick_ + kKeyRegenerationHardTicks || diff --git a/chrome/browser/invalidation/invalidator_storage_unittest.cc b/chrome/browser/invalidation/invalidator_storage_unittest.cc index b09d8d5..1e6683d 100644 --- a/chrome/browser/invalidation/invalidator_storage_unittest.cc +++ b/chrome/browser/invalidation/invalidator_storage_unittest.cc @@ -55,7 +55,7 @@ TEST_F(InvalidatorStorageTest, SetGetNotifierClientId) { TEST_F(InvalidatorStorageTest, SetGetBootstrapData) { InvalidatorStorage storage(&pref_service_); const std::string mess("n\0tK\0\0l\344", 8); - ASSERT_FALSE(IsStringUTF8(mess)); + ASSERT_FALSE(base::IsStringUTF8(mess)); storage.SetBootstrapData(mess); EXPECT_EQ(mess, storage.GetBootstrapData()); diff --git a/chrome/browser/net/firefox_proxy_settings.cc b/chrome/browser/net/firefox_proxy_settings.cc index bc3b04f..ba7fe94 100644 --- a/chrome/browser/net/firefox_proxy_settings.cc +++ b/chrome/browser/net/firefox_proxy_settings.cc @@ -118,7 +118,7 @@ bool ParsePrefFile(const base::FilePath& pref_file, value = value.substr(1, value.size() - 2); // ValueString only accept valid UTF-8. Simply ignore that entry if it is // not UTF-8. - if (IsStringUTF8(value)) + if (base::IsStringUTF8(value)) prefs->SetString(key, value); else VLOG(1) << "Non UTF8 value for key " << key << ", ignored."; diff --git a/chrome/browser/profile_resetter/jtl_interpreter.cc b/chrome/browser/profile_resetter/jtl_interpreter.cc index a4cbd16..e258078 100644 --- a/chrome/browser/profile_resetter/jtl_interpreter.cc +++ b/chrome/browser/profile_resetter/jtl_interpreter.cc @@ -195,7 +195,7 @@ class StoreValue : public Operation { StoreValue(const std::string& hashed_name, scoped_ptr<base::Value> value) : hashed_name_(hashed_name), value_(value.Pass()) { - DCHECK(IsStringUTF8(hashed_name)); + DCHECK(base::IsStringUTF8(hashed_name)); DCHECK(value_); } virtual ~StoreValue() {} @@ -218,7 +218,7 @@ class CompareStoredValue : public Operation { : hashed_name_(hashed_name), value_(value.Pass()), default_value_(default_value.Pass()) { - DCHECK(IsStringUTF8(hashed_name)); + DCHECK(base::IsStringUTF8(hashed_name)); DCHECK(value_); DCHECK(default_value_); } @@ -244,7 +244,7 @@ class StoreNodeValue : public Operation { public: explicit StoreNodeValue(const std::string& hashed_name) : hashed_name_(hashed_name) { - DCHECK(IsStringUTF8(hashed_name)); + DCHECK(base::IsStringUTF8(hashed_name)); } virtual ~StoreNodeValue() {} virtual bool Execute(ExecutionContext* context) OVERRIDE { @@ -275,7 +275,7 @@ class StoreNodeRegisterableDomain : public Operation { public: explicit StoreNodeRegisterableDomain(const std::string& hashed_name) : hashed_name_(hashed_name) { - DCHECK(IsStringUTF8(hashed_name)); + DCHECK(base::IsStringUTF8(hashed_name)); } virtual ~StoreNodeRegisterableDomain() {} virtual bool Execute(ExecutionContext* context) OVERRIDE { @@ -488,7 +488,7 @@ class Parser { break; case jtl_foundation::STORE_BOOL: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; bool value = false; if (!ReadBool(&value)) @@ -500,7 +500,7 @@ class Parser { } case jtl_foundation::COMPARE_STORED_BOOL: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; bool value = false; if (!ReadBool(&value)) @@ -517,7 +517,7 @@ class Parser { } case jtl_foundation::STORE_HASH: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; std::string hashed_value; if (!ReadHash(&hashed_value)) @@ -529,7 +529,7 @@ class Parser { } case jtl_foundation::COMPARE_STORED_HASH: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; std::string hashed_value; if (!ReadHash(&hashed_value)) @@ -546,21 +546,21 @@ class Parser { } case jtl_foundation::STORE_NODE_BOOL: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; operators.push_back(new StoreNodeValue<true>(hashed_name)); break; } case jtl_foundation::STORE_NODE_HASH: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; operators.push_back(new StoreNodeValue<false>(hashed_name)); break; } case jtl_foundation::STORE_NODE_REGISTERABLE_DOMAIN_HASH: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; operators.push_back(new StoreNodeRegisterableDomain(hashed_name)); break; @@ -588,14 +588,14 @@ class Parser { } case jtl_foundation::COMPARE_NODE_TO_STORED_BOOL: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; operators.push_back(new CompareNodeToStored<true>(hashed_name)); break; } case jtl_foundation::COMPARE_NODE_TO_STORED_HASH: { std::string hashed_name; - if (!ReadHash(&hashed_name) || !IsStringUTF8(hashed_name)) + if (!ReadHash(&hashed_name) || !base::IsStringUTF8(hashed_name)) return false; operators.push_back(new CompareNodeToStored<false>(hashed_name)); break; diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc index a34c7b6..e7b9140 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc @@ -76,7 +76,7 @@ ChecksumStatus LoadFile(const base::FilePath& file_path, WordList& words) { // Returns true for invalid words and false for valid words. bool IsInvalidWord(const std::string& word) { std::string tmp; - return !IsStringUTF8(word) || + return !base::IsStringUTF8(word) || word.length() > chrome::spellcheck_common::MAX_CUSTOM_DICTIONARY_WORD_BYTES || word.empty() || diff --git a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc index 6491146..545b773 100644 --- a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc +++ b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc @@ -321,7 +321,7 @@ void APIUtil::DidGetDirectory(const std::string& parent_resource_id, google_apis::GDataErrorCode error, scoped_ptr<google_apis::ResourceList> feed) { DCHECK(CalledOnValidThread()); - DCHECK(IsStringASCII(directory_name)); + DCHECK(base::IsStringASCII(directory_name)); if (error != google_apis::HTTP_SUCCESS) { DVLOG(2) << "Error on getting Drive directory: " << error; diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc index b016ec9..c07a0d55 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -1220,7 +1220,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnHSTSQuery( CHECK(list->GetString(0, &domain)); base::DictionaryValue* result = new base::DictionaryValue(); - if (!IsStringASCII(domain)) { + if (!base::IsStringASCII(domain)) { result->SetString("error", "non-ASCII domain name"); } else { net::TransportSecurityState* transport_security_state = @@ -1261,7 +1261,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnHSTSAdd( // include subdomains>, <key pins>]. std::string domain; CHECK(list->GetString(0, &domain)); - if (!IsStringASCII(domain)) { + if (!base::IsStringASCII(domain)) { // Silently fail. The user will get a helpful error if they query for the // name. return; @@ -1295,7 +1295,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnHSTSDelete( // |list| should be: [<domain to query>]. std::string domain; CHECK(list->GetString(0, &domain)); - if (!IsStringASCII(domain)) { + if (!base::IsStringASCII(domain)) { // There cannot be a unicode entry in the HSTS set. return; } diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index f186053..2c6723f 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -350,7 +350,7 @@ void GarbageCollectExtensions( } // Parse directory name as a potential extension ID. - if (IsStringASCII(basename.value())) { + if (base::IsStringASCII(basename.value())) { extension_id = base::UTF16ToASCII(basename.LossyDisplayName()); if (!Extension::IdIsValid(extension_id)) extension_id.clear(); diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc index 2753614..9a699b2 100644 --- a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc +++ b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc @@ -304,7 +304,7 @@ static bool IsScriptValid(const base::FilePath& path, return false; } - if (!IsStringUTF8(content)) { + if (!base::IsStringUTF8(content)) { *error = l10n_util::GetStringFUTF8( IDS_EXTENSION_BAD_FILE_ENCODING, relative_path.LossyDisplayName()); diff --git a/chrome/common/net/url_fixer_upper.cc b/chrome/common/net/url_fixer_upper.cc index 5c72023..33a84b8 100644 --- a/chrome/common/net/url_fixer_upper.cc +++ b/chrome/common/net/url_fixer_upper.cc @@ -51,7 +51,7 @@ url_parse::Component UTF8ComponentToUTF16Component( void UTF8PartsToUTF16Parts(const std::string& text_utf8, const url_parse::Parsed& parts_utf8, url_parse::Parsed* parts) { - if (IsStringASCII(text_utf8)) { + if (base::IsStringASCII(text_utf8)) { *parts = parts_utf8; return; } @@ -80,7 +80,7 @@ base::TrimPositions TrimWhitespaceUTF8(const std::string& input, // This implementation is not so fast since it converts the text encoding // twice. Please feel free to file a bug if this function hurts the // performance of Chrome. - DCHECK(IsStringUTF8(input)); + DCHECK(base::IsStringUTF8(input)); base::string16 input16 = base::UTF8ToUTF16(input); base::string16 output16; base::TrimPositions result = diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index a5ed9d9..e6cc475 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -661,7 +661,7 @@ void InstallerState::GetExistingExeVersions( FileVersionInfo::CreateFileVersionInfo(chrome_exe)); if (file_version_info) { base::string16 version_string = file_version_info->file_version(); - if (!version_string.empty() && IsStringASCII(version_string)) + if (!version_string.empty() && base::IsStringASCII(version_string)) existing_versions->insert(base::UTF16ToASCII(version_string)); } } |