Move StringToLowerASCII to base namespace
TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
android_webview/browser
ash/system/chromeos/network
base
chrome
app
browser
chromeos
component_updater
enumerate_modules_model_win.ccextensions
api
file_system
gcm
music_manager_private
web_request
updater
importer
install_verification
media_galleries
fileapi
prefs
profiles
renderer_host
pepper
search
shell_integration_win.ccspellchecker
ui
webui
extensions
common
installer
renderer
pepper
plugins
safe_browsing
test
chromedriver
chromeos
cloud_print/gcp20/prototype
components
autofill
content
browser
wallet
core
language_usage_metrics
nacl
os_crypt
plugins
renderer
policy
core
common
query_parser
signin
core
browser
storage_monitor
translate
core
language_detection
url_matcher
content
crypto
extensions
browser
common
google_apis
gpu
net
base
data_url.ccfilename_util_internal.ccfilename_util_unittest.cchost_mapping_rules.ccmime_util.ccsdch_manager.cc
cert
cookies
dns
ftp
http
http_auth_gssapi_posix.cchttp_auth_handler_factory.cchttp_auth_sspi_win.cchttp_log_util.cchttp_response_headers.cchttp_util.cc
proxy
server
spdy
test
embedded_test_server
tools
quic
url_request
websockets
pdf
ppapi/proxy
remoting/host/setup
sql
sync/internal_api/public/base
ui
base
clipboard
gfx
gl
webkit/common/database
@ -168,7 +168,7 @@ std::string AwContentBrowserClient::GetAcceptLangsImpl() {
|
||||
|
||||
// If we're not en-US, add in en-US which will be
|
||||
// used with a lower q-value.
|
||||
if (StringToLowerASCII(langs) != "en-us") {
|
||||
if (base::StringToLowerASCII(langs) != "en-us") {
|
||||
langs += ",en-US";
|
||||
}
|
||||
return langs;
|
||||
|
@ -567,8 +567,8 @@ base::string16 ErrorString(const std::string& error,
|
||||
IDS_CHROMEOS_NETWORK_ERROR_PPP_AUTH_FAILED);
|
||||
}
|
||||
|
||||
if (StringToLowerASCII(error) ==
|
||||
StringToLowerASCII(std::string(shill::kUnknownString))) {
|
||||
if (base::StringToLowerASCII(error) ==
|
||||
base::StringToLowerASCII(std::string(shill::kUnknownString))) {
|
||||
return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN);
|
||||
}
|
||||
return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR,
|
||||
|
@ -96,7 +96,7 @@ void AppendSwitchesAndArguments(CommandLine& command_line,
|
||||
// Lowercase switches for backwards compatiblity *on Windows*.
|
||||
std::string LowerASCIIOnWindows(const std::string& string) {
|
||||
#if defined(OS_WIN)
|
||||
return StringToLowerASCII(string);
|
||||
return base::StringToLowerASCII(string);
|
||||
#elif defined(OS_POSIX)
|
||||
return string;
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@ class EnvironmentImpl : public base::Environment {
|
||||
if (first_char >= 'a' && first_char <= 'z')
|
||||
alternate_case_var = StringToUpperASCII(std::string(variable_name));
|
||||
else if (first_char >= 'A' && first_char <= 'Z')
|
||||
alternate_case_var = StringToLowerASCII(std::string(variable_name));
|
||||
alternate_case_var = base::StringToLowerASCII(std::string(variable_name));
|
||||
else
|
||||
return false;
|
||||
return GetVarImpl(alternate_case_var.c_str(), result);
|
||||
|
@ -33,7 +33,7 @@ std::string GetLocaleString(const icu::Locale& locale) {
|
||||
|
||||
if (variant != NULL && *variant != '\0') {
|
||||
std::string variant_str(variant);
|
||||
StringToLowerASCII(&variant_str);
|
||||
base::StringToLowerASCII(&variant_str);
|
||||
result += '@' + variant_str;
|
||||
}
|
||||
|
||||
|
@ -249,6 +249,20 @@ BASE_EXPORT bool IsStringUTF8(const std::string& str);
|
||||
BASE_EXPORT bool IsStringASCII(const StringPiece& str);
|
||||
BASE_EXPORT bool IsStringASCII(const string16& str);
|
||||
|
||||
// Converts the elements of the given string. This version uses a pointer to
|
||||
// clearly differentiate it from the non-pointer variant.
|
||||
template <class str> inline void StringToLowerASCII(str* s) {
|
||||
for (typename str::iterator i = s->begin(); i != s->end(); ++i)
|
||||
*i = ToLowerASCII(*i);
|
||||
}
|
||||
|
||||
template <class str> inline str StringToLowerASCII(const str& s) {
|
||||
// for std::string and std::wstring
|
||||
str output(s);
|
||||
StringToLowerASCII(&output);
|
||||
return output;
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@ -259,20 +273,6 @@ BASE_EXPORT bool IsStringASCII(const string16& str);
|
||||
#error Define string operations appropriately for your platform
|
||||
#endif
|
||||
|
||||
// Converts the elements of the given string. This version uses a pointer to
|
||||
// clearly differentiate it from the non-pointer variant.
|
||||
template <class str> inline void StringToLowerASCII(str* s) {
|
||||
for (typename str::iterator i = s->begin(); i != s->end(); ++i)
|
||||
*i = base::ToLowerASCII(*i);
|
||||
}
|
||||
|
||||
template <class str> inline str StringToLowerASCII(const str& s) {
|
||||
// for std::string and std::wstring
|
||||
str output(s);
|
||||
StringToLowerASCII(&output);
|
||||
return output;
|
||||
}
|
||||
|
||||
// Converts the elements of the given string. This version uses a pointer to
|
||||
// clearly differentiate it from the non-pointer variant.
|
||||
template <class str> inline void StringToUpperASCII(str* s) {
|
||||
|
@ -145,7 +145,7 @@ bool HasDeprecatedArguments(const std::wstring& command_line) {
|
||||
const wchar_t kChromeHtml[] = L"chromehtml:";
|
||||
std::wstring command_line_lower = command_line;
|
||||
// We are only searching for ASCII characters so this is OK.
|
||||
StringToLowerASCII(&command_line_lower);
|
||||
base::StringToLowerASCII(&command_line_lower);
|
||||
std::wstring::size_type pos = command_line_lower.find(kChromeHtml);
|
||||
return (pos != std::wstring::npos);
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ bool ExtractPublicKeyHash(const CERT_CONTEXT* cert_context,
|
||||
crypt_blob.pbData), crypt_blob.cbData);
|
||||
crypto::SHA256HashString(key_bytes, hash, crypto::kSHA256Length);
|
||||
|
||||
*public_key_hash = StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
*public_key_hash =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class SignatureValidatorTest : public testing::Test {
|
||||
crypto::SHA256HashString(key_bytes, hash, crypto::kSHA256Length);
|
||||
|
||||
std::string public_key_hash =
|
||||
StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
base::StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
expected_hashes_.push_back(public_key_hash);
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ void ServicesCustomizationDocument::StartFetching() {
|
||||
&customization_id) &&
|
||||
!customization_id.empty()) {
|
||||
url_ = GURL(base::StringPrintf(
|
||||
kManifestUrl, StringToLowerASCII(customization_id).c_str()));
|
||||
kManifestUrl, base::StringToLowerASCII(customization_id).c_str()));
|
||||
} else {
|
||||
// Remember that there is no customization ID in VPD.
|
||||
OnCustomizationNotFound();
|
||||
|
@ -187,7 +187,7 @@ void UpdateDefaultTask(PrefService* pref_service,
|
||||
iter != suffixes.end(); ++iter) {
|
||||
base::StringValue* value = new base::StringValue(task_id);
|
||||
// Suffixes are case insensitive.
|
||||
std::string lower_suffix = StringToLowerASCII(*iter);
|
||||
std::string lower_suffix = base::StringToLowerASCII(*iter);
|
||||
mime_type_pref->SetWithoutPathExpansion(lower_suffix, value);
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ std::string GetDefaultTaskIdFromPrefs(const PrefService& pref_service,
|
||||
pref_service.GetDictionary(prefs::kDefaultTasksBySuffix);
|
||||
DCHECK(suffix_task_prefs);
|
||||
LOG_IF(ERROR, !suffix_task_prefs) << "Unable to open suffix prefs";
|
||||
std::string lower_suffix = StringToLowerASCII(suffix);
|
||||
std::string lower_suffix = base::StringToLowerASCII(suffix);
|
||||
if (suffix_task_prefs)
|
||||
suffix_task_prefs->GetStringWithoutPathExpansion(lower_suffix, &task_id);
|
||||
VLOG_IF(1, !task_id.empty()) << "Found suffix default handler: " << task_id;
|
||||
|
@ -1137,7 +1137,7 @@ void ExistingUserController::InitializeStartUrls() const {
|
||||
const char* url = kChromeVoxTutorialURLPattern;
|
||||
PrefService* prefs = g_browser_process->local_state();
|
||||
const std::string current_locale =
|
||||
StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale));
|
||||
base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale));
|
||||
std::string vox_url = base::StringPrintf(url, current_locale.c_str());
|
||||
start_urls.push_back(vox_url);
|
||||
can_show_getstarted_guide = false;
|
||||
|
@ -40,7 +40,7 @@ const int kMasterKeySize = 32;
|
||||
std::string CreateSalt() {
|
||||
char result[kSaltSize];
|
||||
crypto::RandBytes(&result, sizeof(result));
|
||||
return StringToLowerASCII(base::HexEncode(
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(result),
|
||||
sizeof(result)));
|
||||
}
|
||||
@ -163,7 +163,7 @@ bool SupervisedUserAuthentication::FillDataForNewUser(
|
||||
std::string SupervisedUserAuthentication::GenerateMasterKey() {
|
||||
char master_key_bytes[kMasterKeySize];
|
||||
crypto::RandBytes(&master_key_bytes, sizeof(master_key_bytes));
|
||||
return StringToLowerASCII(
|
||||
return base::StringToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(master_key_bytes),
|
||||
sizeof(master_key_bytes)));
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ std::string ExtractBluetoothAddress(const std::string& path) {
|
||||
if (key_len <= 0)
|
||||
return std::string();
|
||||
std::string reverse_address = path.substr(header_size, key_len);
|
||||
StringToLowerASCII(&reverse_address);
|
||||
base::StringToLowerASCII(&reverse_address);
|
||||
std::vector<std::string> result;
|
||||
base::SplitString(reverse_address, ':', &result);
|
||||
std::reverse(result.begin(), result.end());
|
||||
@ -187,7 +187,7 @@ void PeripheralBatteryObserver::InitializeOnBluetoothReady(
|
||||
void PeripheralBatteryObserver::RemoveBattery(const std::string& address) {
|
||||
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
||||
std::string address_lowercase = address;
|
||||
StringToLowerASCII(&address_lowercase);
|
||||
base::StringToLowerASCII(&address_lowercase);
|
||||
std::map<std::string, BatteryInfo>::iterator it =
|
||||
batteries_.find(address_lowercase);
|
||||
if (it != batteries_.end()) {
|
||||
|
@ -88,7 +88,7 @@ std::string CryptohomeTokenEncryptor::EncryptTokenWithKey(
|
||||
return std::string();
|
||||
}
|
||||
|
||||
return StringToLowerASCII(base::HexEncode(
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(encoded_token.data()),
|
||||
encoded_token.size()));
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ std::string HexStringToID(const std::string& hexstr) {
|
||||
}
|
||||
|
||||
std::string GetCrxComponentID(const CrxComponent& component) {
|
||||
return HexStringToID(StringToLowerASCII(
|
||||
return HexStringToID(base::StringToLowerASCII(
|
||||
base::HexEncode(&component.pk_hash[0], component.pk_hash.size() / 2)));
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ static void GenerateHash(const std::string& input, std::string* output) {
|
||||
|
||||
uint8 hash[4];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
*output = StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
*output = base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -102,7 +102,7 @@ bool GetFileTypesFromAcceptOption(
|
||||
iter != list->end(); ++iter) {
|
||||
std::vector<base::FilePath::StringType> inner;
|
||||
std::string accept_type = *iter;
|
||||
StringToLowerASCII(&accept_type);
|
||||
base::StringToLowerASCII(&accept_type);
|
||||
net::GetExtensionsForMimeType(accept_type, &inner);
|
||||
if (inner.empty())
|
||||
continue;
|
||||
@ -127,7 +127,7 @@ bool GetFileTypesFromAcceptOption(
|
||||
for (std::vector<std::string>::const_iterator iter = list->begin();
|
||||
iter != list->end(); ++iter) {
|
||||
std::string extension = *iter;
|
||||
StringToLowerASCII(&extension);
|
||||
base::StringToLowerASCII(&extension);
|
||||
#if defined(OS_WIN)
|
||||
extension_set.insert(base::UTF8ToWide(*iter));
|
||||
#else
|
||||
|
@ -69,7 +69,7 @@ const char* GcmResultToError(gcm::GCMClient::Result result) {
|
||||
}
|
||||
|
||||
bool IsMessageKeyValid(const std::string& key) {
|
||||
std::string lower = StringToLowerASCII(key);
|
||||
std::string lower = base::StringToLowerASCII(key);
|
||||
return !key.empty() &&
|
||||
key.compare(0, arraysize(kCollapseKey) - 1, kCollapseKey) != 0 &&
|
||||
lower.compare(0,
|
||||
|
@ -24,8 +24,8 @@ bool ComputeHmacSha256(const std::string& key,
|
||||
bool result = hmac.Init(key) &&
|
||||
hmac.Sign(text, &digest[0], digest.size());
|
||||
if (result) {
|
||||
*signature_return = StringToLowerASCII(base::HexEncode(digest.data(),
|
||||
digest.size()));
|
||||
*signature_return = base::StringToLowerASCII(
|
||||
base::HexEncode(digest.data(), digest.size()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ class MacAddressProcessor {
|
||||
|
||||
// Got one!
|
||||
found_mac_address_ =
|
||||
StringToLowerASCII(base::HexEncode(mac_address, MAC_LENGTH));
|
||||
base::StringToLowerASCII(base::HexEncode(mac_address, MAC_LENGTH));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,8 +133,8 @@ class MacAddressProcessor {
|
||||
if (!is_valid_mac_address_.Run(mac_address, mac_address_size))
|
||||
return keep_going;
|
||||
|
||||
std::string mac_address_string =
|
||||
StringToLowerASCII(base::HexEncode(mac_address, mac_address_size));
|
||||
std::string mac_address_string = base::StringToLowerASCII(base::HexEncode(
|
||||
mac_address, mac_address_size));
|
||||
|
||||
base::ScopedCFTypeRef<CFStringRef> provider_class(
|
||||
static_cast<CFStringRef>(
|
||||
|
@ -76,7 +76,7 @@ class MacAddressProcessor {
|
||||
if (!is_valid_mac_address_.Run(bytes, size))
|
||||
return;
|
||||
|
||||
found_mac_address_ = StringToLowerASCII(base::HexEncode(bytes, size));
|
||||
found_mac_address_ = base::StringToLowerASCII(base::HexEncode(bytes, size));
|
||||
found_index_ = index;
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ EventResponseDelta* CalculateOnHeadersReceivedDelta(
|
||||
std::string value;
|
||||
while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) {
|
||||
std::string name_lowercase(name);
|
||||
StringToLowerASCII(&name_lowercase);
|
||||
base::StringToLowerASCII(&name_lowercase);
|
||||
|
||||
bool header_found = false;
|
||||
for (ResponseHeaders::const_iterator i = new_response_headers->begin();
|
||||
@ -1017,7 +1017,7 @@ void MergeCookiesInOnHeadersReceivedResponses(
|
||||
// Converts the key of the (key, value) pair to lower case.
|
||||
static ResponseHeader ToLowerCase(const ResponseHeader& header) {
|
||||
std::string lower_key(header.first);
|
||||
StringToLowerASCII(&lower_key);
|
||||
base::StringToLowerASCII(&lower_key);
|
||||
return ResponseHeader(lower_key, header.second);
|
||||
}
|
||||
|
||||
@ -1026,13 +1026,13 @@ static ResponseHeader ToLowerCase(const ResponseHeader& header) {
|
||||
static std::string FindRemoveResponseHeader(
|
||||
const EventResponseDeltas& deltas,
|
||||
const std::string& key) {
|
||||
std::string lower_key = StringToLowerASCII(key);
|
||||
std::string lower_key = base::StringToLowerASCII(key);
|
||||
EventResponseDeltas::const_iterator delta;
|
||||
for (delta = deltas.begin(); delta != deltas.end(); ++delta) {
|
||||
ResponseHeaders::const_iterator i;
|
||||
for (i = (*delta)->deleted_response_headers.begin();
|
||||
i != (*delta)->deleted_response_headers.end(); ++i) {
|
||||
if (StringToLowerASCII(i->first) == lower_key)
|
||||
if (base::StringToLowerASCII(i->first) == lower_key)
|
||||
return (*delta)->extension_id;
|
||||
}
|
||||
}
|
||||
|
@ -1925,7 +1925,7 @@ void ExtensionService::TerminateExtension(const std::string& extension_id) {
|
||||
}
|
||||
|
||||
void ExtensionService::UntrackTerminatedExtension(const std::string& id) {
|
||||
std::string lowercase_id = StringToLowerASCII(id);
|
||||
std::string lowercase_id = base::StringToLowerASCII(id);
|
||||
const Extension* extension =
|
||||
registry_->terminated_extensions().GetByID(lowercase_id);
|
||||
registry_->RemoveTerminated(lowercase_id);
|
||||
|
@ -90,7 +90,7 @@ void ExternalRegistryLoader::LoadOnFileThread() {
|
||||
}
|
||||
|
||||
std::string id = base::UTF16ToASCII(*it);
|
||||
StringToLowerASCII(&id);
|
||||
base::StringToLowerASCII(&id);
|
||||
if (!Extension::IdIsValid(id)) {
|
||||
LOG(ERROR) << "Invalid id value " << id
|
||||
<< " for key " << key_path << ".";
|
||||
|
@ -305,7 +305,7 @@ void LocalExtensionCache::BackendCheckCacheContentsInternal(
|
||||
}
|
||||
|
||||
// Enforce a lower-case id.
|
||||
id = StringToLowerASCII(id);
|
||||
id = base::StringToLowerASCII(id);
|
||||
if (!extensions::Extension::IdIsValid(id)) {
|
||||
LOG(ERROR) << "Bad extension id in cache: " << id;
|
||||
id.clear();
|
||||
|
@ -478,7 +478,7 @@ bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) {
|
||||
// of an extension or a "/" in the case of a MIME type).
|
||||
std::string unused;
|
||||
if (accept_type.length() <= 1 ||
|
||||
StringToLowerASCII(accept_type) != accept_type ||
|
||||
base::StringToLowerASCII(accept_type) != accept_type ||
|
||||
base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) !=
|
||||
base::TRIM_NONE) {
|
||||
return false;
|
||||
|
@ -183,7 +183,7 @@ int IconSizeToDIPSize(IconLoader::IconSize size) {
|
||||
// static
|
||||
IconGroupID IconLoader::ReadGroupIDFromFilepath(
|
||||
const base::FilePath& filepath) {
|
||||
return StringToLowerASCII(filepath.Extension());
|
||||
return base::StringToLowerASCII(filepath.Extension());
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -75,7 +75,7 @@ class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter {
|
||||
// TemplateURLParser::ParameterFilter method.
|
||||
virtual bool KeepParameter(const std::string& key,
|
||||
const std::string& value) OVERRIDE {
|
||||
std::string low_value = StringToLowerASCII(value);
|
||||
std::string low_value = base::StringToLowerASCII(value);
|
||||
if (low_value.find("mozilla") != std::string::npos ||
|
||||
low_value.find("firefox") != std::string::npos ||
|
||||
low_value.find("moz:") != std::string::npos) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "chrome/browser/install_verification/win/module_list.h"
|
||||
|
||||
std::string CalculateModuleNameDigest(const base::string16& module_name) {
|
||||
return base::MD5String(StringToLowerASCII(base::UTF16ToUTF8(
|
||||
return base::MD5String(base::StringToLowerASCII(base::UTF16ToUTF8(
|
||||
base::FilePath(module_name).BaseName().value())));
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,8 @@ bool MediaPathFilter::Match(const base::FilePath& path) {
|
||||
MediaGalleryScanFileType MediaPathFilter::GetType(const base::FilePath& path) {
|
||||
EnsureInitialized();
|
||||
MediaFileExtensionMap::const_iterator it =
|
||||
media_file_extensions_map_.find(StringToLowerASCII(path.Extension()));
|
||||
media_file_extensions_map_.find(
|
||||
base::StringToLowerASCII(path.Extension()));
|
||||
if (it == media_file_extensions_map_.end())
|
||||
return MEDIA_GALLERY_SCAN_FILE_TYPE_UNKNOWN;
|
||||
return static_cast<MediaGalleryScanFileType>(it->second);
|
||||
|
@ -86,7 +86,7 @@ std::string GenerateDeviceIdLikePrefMetricsServiceDid(
|
||||
const std::string& original_device_id) {
|
||||
if (original_device_id.empty())
|
||||
return std::string();
|
||||
return StringToLowerASCII(
|
||||
return base::StringToLowerASCII(
|
||||
GetDigestString(original_device_id, "PrefMetricsService"));
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ ProfileIOData* ProfileIOData::FromResourceContext(
|
||||
|
||||
// static
|
||||
bool ProfileIOData::IsHandledProtocol(const std::string& scheme) {
|
||||
DCHECK_EQ(scheme, StringToLowerASCII(scheme));
|
||||
DCHECK_EQ(scheme, base::StringToLowerASCII(scheme));
|
||||
static const char* const kProtocolList[] = {
|
||||
url::kFileScheme,
|
||||
content::kChromeDevToolsScheme,
|
||||
|
@ -162,13 +162,13 @@ void DeviceIDFetcher::ComputeOnUIThread(const std::string& salt,
|
||||
input.append(kDRMIdentifierFile);
|
||||
input.append(salt_bytes.begin(), salt_bytes.end());
|
||||
crypto::SHA256HashString(input, &id_buf, sizeof(id_buf));
|
||||
std::string id = StringToLowerASCII(
|
||||
std::string id = base::StringToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(id_buf), sizeof(id_buf)));
|
||||
input = machine_id;
|
||||
input.append(kDRMIdentifierFile);
|
||||
input.append(id);
|
||||
crypto::SHA256HashString(input, &id_buf, sizeof(id_buf));
|
||||
id = StringToLowerASCII(
|
||||
id = base::StringToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(id_buf), sizeof(id_buf)));
|
||||
|
||||
RunCallbackOnIOThread(id, PP_OK);
|
||||
|
@ -173,7 +173,7 @@ const char kHotwordUnusablePrefName[] = "hotword.search_enabled";
|
||||
bool HotwordService::DoesHotwordSupportLanguage(Profile* profile) {
|
||||
std::string normalized_locale =
|
||||
l10n_util::NormalizeLocale(GetCurrentLocale(profile));
|
||||
StringToLowerASCII(&normalized_locale);
|
||||
base::StringToLowerASCII(&normalized_locale);
|
||||
|
||||
for (size_t i = 0; i < arraysize(kSupportedLocales); i++) {
|
||||
if (normalized_locale.compare(0, 2, kSupportedLocales[i]) == 0)
|
||||
|
@ -384,7 +384,8 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() {
|
||||
base::win::RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ);
|
||||
base::string16 app_cmd;
|
||||
if (key.Valid() && (key.ReadValue(L"", &app_cmd) == ERROR_SUCCESS) &&
|
||||
base::string16::npos != StringToLowerASCII(app_cmd).find(L"firefox"))
|
||||
base::string16::npos !=
|
||||
base::StringToLowerASCII(app_cmd).find(L"firefox"))
|
||||
ff_default = true;
|
||||
}
|
||||
return ff_default;
|
||||
|
@ -220,7 +220,7 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
DCHECK(!bdict_file.empty());
|
||||
|
||||
return GURL(std::string(kDownloadServerUrl) +
|
||||
StringToLowerASCII(bdict_file));
|
||||
base::StringToLowerASCII(bdict_file));
|
||||
}
|
||||
|
||||
void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
|
||||
|
@ -275,7 +275,7 @@ bool ExtensionIconSource::ParseData(
|
||||
int request_id,
|
||||
const content::URLDataSource::GotDataCallback& callback) {
|
||||
// Extract the parameters from the path by lower casing and splitting.
|
||||
std::string path_lower = StringToLowerASCII(path);
|
||||
std::string path_lower = base::StringToLowerASCII(path);
|
||||
std::vector<std::string> path_parts;
|
||||
|
||||
base::SplitString(path_lower, '/', &path_parts);
|
||||
|
@ -176,7 +176,7 @@ ContentSettingsPattern ContentSettingsPattern::Builder::Build() {
|
||||
// static
|
||||
bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) {
|
||||
// Canonicalize the scheme part.
|
||||
const std::string scheme(StringToLowerASCII(parts->scheme));
|
||||
const std::string scheme(base::StringToLowerASCII(parts->scheme));
|
||||
parts->scheme = scheme;
|
||||
|
||||
if (parts->scheme == std::string(url::kFileScheme) &&
|
||||
|
@ -18,7 +18,7 @@ ProtocolHandler::ProtocolHandler(const std::string& protocol,
|
||||
ProtocolHandler ProtocolHandler::CreateProtocolHandler(
|
||||
const std::string& protocol,
|
||||
const GURL& url) {
|
||||
std::string lower_protocol = StringToLowerASCII(protocol);
|
||||
std::string lower_protocol = base::StringToLowerASCII(protocol);
|
||||
return ProtocolHandler(lower_protocol, url);
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ FileBrowserHandler* LoadFileBrowserHandler(
|
||||
errors::kInvalidFileFilterValue, base::IntToString(i));
|
||||
return NULL;
|
||||
}
|
||||
StringToLowerASCII(&filter);
|
||||
base::StringToLowerASCII(&filter);
|
||||
if (!StartsWithASCII(filter,
|
||||
std::string(url::kFileSystemScheme) + ':',
|
||||
true)) {
|
||||
|
@ -322,7 +322,7 @@ base::string16 GetFirefoxImporterName(const base::FilePath& app_path) {
|
||||
}
|
||||
}
|
||||
|
||||
StringToLowerASCII(&branding_name);
|
||||
base::StringToLowerASCII(&branding_name);
|
||||
if (branding_name.find("iceweasel") != std::string::npos)
|
||||
return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL);
|
||||
return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX);
|
||||
|
@ -262,7 +262,7 @@ bool LanguageSelector::SelectIf(const std::vector<std::wstring>& candidates,
|
||||
for (std::vector<std::wstring>::const_iterator scan = candidates.begin(),
|
||||
end = candidates.end(); scan != end; ++scan) {
|
||||
candidate.assign(*scan);
|
||||
StringToLowerASCII(&candidate);
|
||||
base::StringToLowerASCII(&candidate);
|
||||
if (select_predicate(candidate, matched_offset)) {
|
||||
matched_name->assign(*scan);
|
||||
return true;
|
||||
|
@ -317,7 +317,8 @@ int32_t PepperFlashRendererHost::OnNavigate(
|
||||
data.headers.begin(), data.headers.end(), "\n\r");
|
||||
bool rejected = false;
|
||||
while (header_iter.GetNext()) {
|
||||
std::string lower_case_header_name = StringToLowerASCII(header_iter.name());
|
||||
std::string lower_case_header_name =
|
||||
base::StringToLowerASCII(header_iter.name());
|
||||
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
|
||||
rejected = true;
|
||||
|
||||
|
@ -107,7 +107,7 @@ void PluginUMAReporter::ExtractFileExtension(const GURL& src,
|
||||
extension->clear();
|
||||
}
|
||||
|
||||
StringToLowerASCII(extension);
|
||||
base::StringToLowerASCII(extension);
|
||||
}
|
||||
|
||||
PluginUMAReporter::PluginType PluginUMAReporter::GetPluginType(
|
||||
@ -116,7 +116,7 @@ PluginUMAReporter::PluginType PluginUMAReporter::GetPluginType(
|
||||
// If we know plugin's mime type, we use it to determine plugin's type. Else,
|
||||
// we try to determine plugin type using plugin source's extension.
|
||||
if (!plugin_mime_type.empty())
|
||||
return MimeTypeToPluginType(StringToLowerASCII(plugin_mime_type));
|
||||
return MimeTypeToPluginType(base::StringToLowerASCII(plugin_mime_type));
|
||||
|
||||
return SrcToPluginType(plugin_src);
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ void PhishingDOMFeatureExtractor::HandleInput(
|
||||
// WebFormControlElement::formControlType() for consistency with the
|
||||
// way the phishing classification model is created.
|
||||
std::string type = element.getAttribute("type").utf8();
|
||||
StringToLowerASCII(&type);
|
||||
base::StringToLowerASCII(&type);
|
||||
if (type == "password") {
|
||||
++page_feature_state_->num_pswd_inputs;
|
||||
} else if (type == "radio") {
|
||||
|
@ -185,7 +185,7 @@ Status ParseProxy(const base::Value& option, Capabilities* capabilities) {
|
||||
std::string proxy_type;
|
||||
if (!proxy_dict->GetString("proxyType", &proxy_type))
|
||||
return Status(kUnknownError, "'proxyType' must be a string");
|
||||
proxy_type = StringToLowerASCII(proxy_type);
|
||||
proxy_type = base::StringToLowerASCII(proxy_type);
|
||||
if (proxy_type == "direct") {
|
||||
capabilities->switches.SetSwitch("no-proxy-server");
|
||||
} else if (proxy_type == "system") {
|
||||
|
@ -538,7 +538,8 @@ void ConvertHexadecimalToIDAlphabet(std::string* id) {
|
||||
std::string GenerateExtensionId(const std::string& input) {
|
||||
uint8 hash[16];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
std::string output = StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
std::string output =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
ConvertHexadecimalToIDAlphabet(&output);
|
||||
return output;
|
||||
}
|
||||
|
@ -694,7 +694,7 @@ namespace internal {
|
||||
const char kNewSessionPathPattern[] = "session";
|
||||
|
||||
bool MatchesMethod(HttpMethod command_method, const std::string& method) {
|
||||
std::string lower_method = StringToLowerASCII(method);
|
||||
std::string lower_method = base::StringToLowerASCII(method);
|
||||
switch (command_method) {
|
||||
case kGet:
|
||||
return lower_method == "get";
|
||||
|
@ -94,7 +94,7 @@ SystemSaltGetter* SystemSaltGetter::Get() {
|
||||
// static
|
||||
std::string SystemSaltGetter::ConvertRawSaltToHexString(
|
||||
const std::vector<uint8>& salt) {
|
||||
return StringToLowerASCII(base::HexEncode(
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(salt.data()), salt.size()));
|
||||
}
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ bool FakeShillManagerClient::ParseOption(const std::string& arg0,
|
||||
bool FakeShillManagerClient::SetInitialNetworkState(std::string type_arg,
|
||||
std::string state_arg) {
|
||||
std::string state;
|
||||
state_arg = StringToLowerASCII(state_arg);
|
||||
state_arg = base::StringToLowerASCII(state_arg);
|
||||
if (state_arg.empty() || state_arg == "1" || state_arg == "on" ||
|
||||
state_arg == "enabled" || state_arg == "connected" ||
|
||||
state_arg == "online") {
|
||||
@ -1029,7 +1029,7 @@ bool FakeShillManagerClient::SetInitialNetworkState(std::string type_arg,
|
||||
return false;
|
||||
}
|
||||
|
||||
type_arg = StringToLowerASCII(type_arg);
|
||||
type_arg = base::StringToLowerASCII(type_arg);
|
||||
// Special cases
|
||||
if (type_arg == "wireless") {
|
||||
shill_initial_state_map_[shill::kTypeWifi] = state;
|
||||
|
@ -84,7 +84,7 @@ void Key::Transform(KeyType target_key_type, const std::string& salt) {
|
||||
// Keep only the first half of the hash for 'weak' hashing so that the
|
||||
// plain text secret cannot be reconstructed even if the hashing is
|
||||
// reversed.
|
||||
secret_ = StringToLowerASCII(base::HexEncode(
|
||||
secret_ = base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(hash), sizeof(hash) / 2));
|
||||
break;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ bool ValidateTicket(const std::string& ticket) {
|
||||
}
|
||||
|
||||
std::string GenerateId() {
|
||||
return StringToLowerASCII(base::GenerateGUID());
|
||||
return base::StringToLowerASCII(base::GenerateGUID());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -35,7 +35,7 @@ bool ActionAppliesToWalletItems(RequiredAction action) {
|
||||
|
||||
RequiredAction ParseRequiredActionFromString(const std::string& str) {
|
||||
std::string str_lower;
|
||||
base::TrimWhitespaceASCII(StringToLowerASCII(str), base::TRIM_ALL,
|
||||
base::TrimWhitespaceASCII(base::StringToLowerASCII(str), base::TRIM_ALL,
|
||||
&str_lower);
|
||||
|
||||
if (str_lower == "setup_wallet")
|
||||
|
@ -43,7 +43,7 @@ const char* const kMonthsFull[] = {
|
||||
// the list of select options in |field|.
|
||||
bool SetSelectControlValue(const base::string16& value,
|
||||
FormFieldData* field) {
|
||||
base::string16 value_lowercase = StringToLowerASCII(value);
|
||||
base::string16 value_lowercase = base::StringToLowerASCII(value);
|
||||
|
||||
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
|
||||
base::string16 best_match;
|
||||
@ -55,8 +55,9 @@ bool SetSelectControlValue(const base::string16& value,
|
||||
break;
|
||||
}
|
||||
|
||||
if (value_lowercase == StringToLowerASCII(field->option_values[i]) ||
|
||||
value_lowercase == StringToLowerASCII(field->option_contents[i])) {
|
||||
if (value_lowercase == base::StringToLowerASCII(field->option_values[i]) ||
|
||||
value_lowercase ==
|
||||
base::StringToLowerASCII(field->option_contents[i])) {
|
||||
// A match, but not in the same case. Save it in case an exact match is
|
||||
// not found.
|
||||
best_match = field->option_values[i];
|
||||
@ -74,15 +75,15 @@ bool SetSelectControlValue(const base::string16& value,
|
||||
// for |value|. For example, "NC - North Carolina" would match "north carolina".
|
||||
bool SetSelectControlValueSubstringMatch(const base::string16& value,
|
||||
FormFieldData* field) {
|
||||
base::string16 value_lowercase = StringToLowerASCII(value);
|
||||
base::string16 value_lowercase = base::StringToLowerASCII(value);
|
||||
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
|
||||
int best_match = -1;
|
||||
|
||||
for (size_t i = 0; i < field->option_values.size(); ++i) {
|
||||
if (StringToLowerASCII(field->option_values[i]).find(value_lowercase) !=
|
||||
if (base::StringToLowerASCII(field->option_values[i]).find(value_lowercase) !=
|
||||
std::string::npos ||
|
||||
StringToLowerASCII(field->option_contents[i]).find(value_lowercase) !=
|
||||
std::string::npos) {
|
||||
base::StringToLowerASCII(field->option_contents[i]).find(
|
||||
value_lowercase) != std::string::npos) {
|
||||
// The best match is the shortest one.
|
||||
if (best_match == -1 ||
|
||||
field->option_values[best_match].size() >
|
||||
@ -105,13 +106,13 @@ bool SetSelectControlValueSubstringMatch(const base::string16& value,
|
||||
// tokens. For example, "NC - North Carolina" would match "nc" but not "ca".
|
||||
bool SetSelectControlValueTokenMatch(const base::string16& value,
|
||||
FormFieldData* field) {
|
||||
base::string16 value_lowercase = StringToLowerASCII(value);
|
||||
base::string16 value_lowercase = base::StringToLowerASCII(value);
|
||||
std::vector<base::string16> tokenized;
|
||||
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
|
||||
|
||||
for (size_t i = 0; i < field->option_values.size(); ++i) {
|
||||
base::SplitStringAlongWhitespace(
|
||||
StringToLowerASCII(field->option_values[i]), &tokenized);
|
||||
base::StringToLowerASCII(field->option_values[i]), &tokenized);
|
||||
if (std::find(tokenized.begin(), tokenized.end(), value_lowercase) !=
|
||||
tokenized.end()) {
|
||||
field->value = field->option_values[i];
|
||||
@ -119,7 +120,7 @@ bool SetSelectControlValueTokenMatch(const base::string16& value,
|
||||
}
|
||||
|
||||
base::SplitStringAlongWhitespace(
|
||||
StringToLowerASCII(field->option_contents[i]), &tokenized);
|
||||
base::StringToLowerASCII(field->option_contents[i]), &tokenized);
|
||||
if (std::find(tokenized.begin(), tokenized.end(), value_lowercase) !=
|
||||
tokenized.end()) {
|
||||
field->value = field->option_values[i];
|
||||
@ -246,15 +247,15 @@ bool FillCreditCardTypeSelectControl(const base::string16& value,
|
||||
FormFieldData* field) {
|
||||
// Try stripping off spaces.
|
||||
base::string16 value_stripped;
|
||||
base::RemoveChars(StringToLowerASCII(value), base::kWhitespaceUTF16,
|
||||
base::RemoveChars(base::StringToLowerASCII(value), base::kWhitespaceUTF16,
|
||||
&value_stripped);
|
||||
|
||||
for (size_t i = 0; i < field->option_values.size(); ++i) {
|
||||
base::string16 option_value_lowercase;
|
||||
base::RemoveChars(StringToLowerASCII(field->option_values[i]),
|
||||
base::RemoveChars(base::StringToLowerASCII(field->option_values[i]),
|
||||
base::kWhitespaceUTF16, &option_value_lowercase);
|
||||
base::string16 option_contents_lowercase;
|
||||
base::RemoveChars(StringToLowerASCII(field->option_contents[i]),
|
||||
base::RemoveChars(base::StringToLowerASCII(field->option_contents[i]),
|
||||
base::kWhitespaceUTF16, &option_contents_lowercase);
|
||||
|
||||
// Perform a case-insensitive comparison; but fill the form with the
|
||||
|
@ -235,7 +235,7 @@ struct CaseInsensitiveStringEquals {
|
||||
|
||||
bool operator()(const base::string16& x) const {
|
||||
return x.size() == other_.size() &&
|
||||
StringToLowerASCII(x) == StringToLowerASCII(other_);
|
||||
base::StringToLowerASCII(x) == base::StringToLowerASCII(other_);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -560,8 +560,8 @@ bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile,
|
||||
app_locale)) {
|
||||
return false;
|
||||
}
|
||||
} else if (StringToLowerASCII(GetRawInfo(*it)) !=
|
||||
StringToLowerASCII(profile.GetRawInfo(*it))) {
|
||||
} else if (base::StringToLowerASCII(GetRawInfo(*it)) !=
|
||||
base::StringToLowerASCII(profile.GetRawInfo(*it))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -593,8 +593,8 @@ void AutofillProfile::OverwriteOrAppendNames(
|
||||
|
||||
AutofillType type = AutofillType(NAME_FULL);
|
||||
base::string16 full_name = current_name.GetInfo(type, app_locale);
|
||||
if (StringToLowerASCII(full_name) ==
|
||||
StringToLowerASCII(imported_name.GetInfo(type, app_locale))) {
|
||||
if (base::StringToLowerASCII(full_name) ==
|
||||
base::StringToLowerASCII(imported_name.GetInfo(type, app_locale))) {
|
||||
// The imported name has the same full name string as one of the
|
||||
// existing names for this profile. Because full names are
|
||||
// _heuristically_ parsed into {first, middle, last} name components,
|
||||
@ -658,8 +658,8 @@ void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& profile,
|
||||
// Single value field --- overwrite.
|
||||
if (!AutofillProfile::SupportsMultiValue(*iter)) {
|
||||
base::string16 new_value = profile.GetRawInfo(*iter);
|
||||
if (StringToLowerASCII(GetRawInfo(*iter)) !=
|
||||
StringToLowerASCII(new_value)) {
|
||||
if (base::StringToLowerASCII(GetRawInfo(*iter)) !=
|
||||
base::StringToLowerASCII(new_value)) {
|
||||
SetRawInfo(*iter, new_value);
|
||||
}
|
||||
continue;
|
||||
|
@ -160,9 +160,12 @@ NameInfo& NameInfo::operator=(const NameInfo& info) {
|
||||
}
|
||||
|
||||
bool NameInfo::ParsedNamesAreEqual(const NameInfo& info) {
|
||||
return (StringToLowerASCII(given_) == StringToLowerASCII(info.given_) &&
|
||||
StringToLowerASCII(middle_) == StringToLowerASCII(info.middle_) &&
|
||||
StringToLowerASCII(family_) == StringToLowerASCII(info.family_));
|
||||
return (base::StringToLowerASCII(given_) ==
|
||||
base::StringToLowerASCII(info.given_) &&
|
||||
base::StringToLowerASCII(middle_) ==
|
||||
base::StringToLowerASCII(info.middle_) &&
|
||||
base::StringToLowerASCII(family_) ==
|
||||
base::StringToLowerASCII(info.family_));
|
||||
}
|
||||
|
||||
void NameInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
|
||||
|
@ -75,7 +75,7 @@ bool ConvertMonth(const base::string16& month,
|
||||
|
||||
// Otherwise, try parsing the |month| as a named month, e.g. "January" or
|
||||
// "Jan".
|
||||
base::string16 lowercased_month = StringToLowerASCII(month);
|
||||
base::string16 lowercased_month = base::StringToLowerASCII(month);
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
icu::Locale locale(app_locale.c_str());
|
||||
@ -88,7 +88,7 @@ bool ConvertMonth(const base::string16& month,
|
||||
for (int32_t i = 0; i < num_months; ++i) {
|
||||
const base::string16 icu_month = base::string16(months[i].getBuffer(),
|
||||
months[i].length());
|
||||
if (lowercased_month == StringToLowerASCII(icu_month)) {
|
||||
if (lowercased_month == base::StringToLowerASCII(icu_month)) {
|
||||
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
|
||||
return true;
|
||||
}
|
||||
@ -98,7 +98,7 @@ bool ConvertMonth(const base::string16& month,
|
||||
for (int32_t i = 0; i < num_months; ++i) {
|
||||
const base::string16 icu_month = base::string16(months[i].getBuffer(),
|
||||
months[i].length());
|
||||
if (lowercased_month == StringToLowerASCII(icu_month)) {
|
||||
if (lowercased_month == base::StringToLowerASCII(icu_month)) {
|
||||
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
|
||||
return true;
|
||||
}
|
||||
|
@ -1017,7 +1017,7 @@ void FormStructure::ParseFieldTypesFromAutocompleteAttributes(
|
||||
// non-space characters (e.g. tab) to spaces, and converting to lowercase.
|
||||
std::string autocomplete_attribute =
|
||||
base::CollapseWhitespaceASCII(field->autocomplete_attribute, false);
|
||||
autocomplete_attribute = StringToLowerASCII(autocomplete_attribute);
|
||||
autocomplete_attribute = base::StringToLowerASCII(autocomplete_attribute);
|
||||
|
||||
// The autocomplete attribute is overloaded: it can specify either a field
|
||||
// type hint or whether autocomplete should be enabled at all. Ignore the
|
||||
|
@ -602,9 +602,9 @@ void PersonalDataManager::GetProfileSuggestions(
|
||||
continue;
|
||||
|
||||
base::string16 profile_value_lower_case(
|
||||
StringToLowerASCII(multi_values[i]));
|
||||
base::StringToLowerASCII(multi_values[i]));
|
||||
base::string16 field_value_lower_case(
|
||||
StringToLowerASCII(field_contents));
|
||||
base::StringToLowerASCII(field_contents));
|
||||
// Phone numbers could be split in US forms, so field value could be
|
||||
// either prefix or suffix of the phone.
|
||||
bool matched_phones = false;
|
||||
@ -751,8 +751,8 @@ std::string PersonalDataManager::MergeProfile(
|
||||
AutofillProfile* existing_profile = *iter;
|
||||
if (!matching_profile_found &&
|
||||
!new_profile.PrimaryValue().empty() &&
|
||||
StringToLowerASCII(existing_profile->PrimaryValue()) ==
|
||||
StringToLowerASCII(new_profile.PrimaryValue())) {
|
||||
base::StringToLowerASCII(existing_profile->PrimaryValue()) ==
|
||||
base::StringToLowerASCII(new_profile.PrimaryValue())) {
|
||||
// Unverified profiles should always be updated with the newer data,
|
||||
// whereas verified profiles should only ever be overwritten by verified
|
||||
// data. If an automatically aggregated profile would overwrite a
|
||||
@ -779,22 +779,23 @@ bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code)
|
||||
const std::vector<AutofillProfile*>& profiles = web_profiles();
|
||||
std::list<std::string> country_codes;
|
||||
for (size_t i = 0; i < profiles.size(); ++i) {
|
||||
country_codes.push_back(StringToLowerASCII(base::UTF16ToASCII(
|
||||
country_codes.push_back(base::StringToLowerASCII(base::UTF16ToASCII(
|
||||
profiles[i]->GetRawInfo(ADDRESS_HOME_COUNTRY))));
|
||||
}
|
||||
|
||||
std::string timezone_country = CountryCodeForCurrentTimezone();
|
||||
if (!timezone_country.empty())
|
||||
country_codes.push_back(StringToLowerASCII(timezone_country));
|
||||
country_codes.push_back(base::StringToLowerASCII(timezone_country));
|
||||
|
||||
// Only take the locale into consideration if all else fails.
|
||||
if (country_codes.empty()) {
|
||||
country_codes.push_back(StringToLowerASCII(
|
||||
country_codes.push_back(base::StringToLowerASCII(
|
||||
AutofillCountry::CountryCodeForLocale(app_locale())));
|
||||
}
|
||||
|
||||
return std::find(country_codes.begin(), country_codes.end(),
|
||||
StringToLowerASCII(country_code)) != country_codes.end();
|
||||
base::StringToLowerASCII(country_code)) !=
|
||||
country_codes.end();
|
||||
}
|
||||
|
||||
const std::string& PersonalDataManager::GetDefaultCountryCodeForNewAddress()
|
||||
|
@ -188,7 +188,7 @@ bool IsUnwantedInElementID(char c) {
|
||||
std::string ScrubElementID(std::string element_id) {
|
||||
std::replace_if(
|
||||
element_id.begin(), element_id.end(), IsUnwantedInElementID, ' ');
|
||||
return StringToLowerASCII(element_id);
|
||||
return base::StringToLowerASCII(element_id);
|
||||
}
|
||||
|
||||
std::string ScrubElementID(const base::string16& element_id) {
|
||||
|
@ -43,7 +43,7 @@ int LanguageUsageMetrics::ToLanguageCode(const std::string& locale) {
|
||||
return 0;
|
||||
|
||||
std::string language_part = parts.token();
|
||||
StringToLowerASCII(&language_part);
|
||||
base::StringToLowerASCII(&language_part);
|
||||
|
||||
int language_code = 0;
|
||||
for (std::string::iterator it = language_part.begin();
|
||||
|
@ -322,7 +322,7 @@ void NexeLoadManager::InitializePlugin(
|
||||
}
|
||||
|
||||
// Store mime_type_ at initialization time since we make it lowercase.
|
||||
mime_type_ = StringToLowerASCII(LookupAttribute(args_, kTypeAttribute));
|
||||
mime_type_ = base::StringToLowerASCII(LookupAttribute(args_, kTypeAttribute));
|
||||
}
|
||||
|
||||
void NexeLoadManager::ReportStartupOverhead() const {
|
||||
|
@ -1587,7 +1587,7 @@ class PexeDownloader : public blink::WebURLLoaderClient {
|
||||
for (std::vector<std::string>::const_iterator it = values.begin();
|
||||
it != values.end();
|
||||
++it) {
|
||||
if (StringToLowerASCII(*it) == "no-store")
|
||||
if (base::StringToLowerASCII(*it) == "no-store")
|
||||
has_no_store_header = true;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ bool GetUserPassFromData(const std::vector<unsigned char>& data,
|
||||
}
|
||||
|
||||
std::wstring GetUrlHash(const std::wstring& url) {
|
||||
std::wstring lower_case_url = StringToLowerASCII(url);
|
||||
std::wstring lower_case_url = base::StringToLowerASCII(url);
|
||||
// Get a data buffer out of our std::wstring to pass to SHA1HashString.
|
||||
std::string url_buffer(
|
||||
reinterpret_cast<const char*>(lower_case_url.c_str()),
|
||||
@ -115,7 +115,7 @@ std::wstring GetUrlHash(const std::wstring& url) {
|
||||
bool DecryptPasswords(const std::wstring& url,
|
||||
const std::vector<unsigned char>& data,
|
||||
std::vector<DecryptedCredentials>* credentials) {
|
||||
std::wstring lower_case_url = StringToLowerASCII(url);
|
||||
std::wstring lower_case_url = base::StringToLowerASCII(url);
|
||||
DATA_BLOB input = {0};
|
||||
DATA_BLOB output = {0};
|
||||
DATA_BLOB url_key = {0};
|
||||
|
@ -51,7 +51,7 @@ bool IsValidYouTubeVideo(const std::string& path) {
|
||||
if (path.length() <= len)
|
||||
return false;
|
||||
|
||||
std::string str = StringToLowerASCII(path);
|
||||
std::string str = base::StringToLowerASCII(path);
|
||||
// Youtube flash url can start with /v/ or /e/.
|
||||
if (strncmp(str.data(), kSlashVSlash, len) != 0 &&
|
||||
strncmp(str.data(), kSlashESlash, len) != 0)
|
||||
|
@ -183,7 +183,7 @@ void HandleRecord(const base::string16& key_name,
|
||||
return;
|
||||
}
|
||||
|
||||
std::string action_trigger(StringToLowerASCII(value_name.substr(
|
||||
std::string action_trigger(base::StringToLowerASCII(value_name.substr(
|
||||
arraysize(kActionTriggerPrefix) - 1)));
|
||||
if (action_trigger == kActionTriggerDeleteValues) {
|
||||
std::vector<std::string> values;
|
||||
|
@ -96,7 +96,8 @@ base::string16 BuildSnippet(const std::string& document,
|
||||
// |document|. We need to add more test cases and change this function
|
||||
// to be more generic depending on how we deal with 'folding for match'
|
||||
// in history.
|
||||
const std::string document_folded = StringToLowerASCII(std::string(document));
|
||||
const std::string document_folded =
|
||||
base::StringToLowerASCII(std::string(document));
|
||||
|
||||
std::vector<std::string> query_words;
|
||||
base::SplitString(query, ' ', &query_words);
|
||||
|
@ -68,7 +68,7 @@ std::string GetTruncatedHash(const std::string& str) {
|
||||
const int kTruncateSize = kTruncateTokenStringLength / 2;
|
||||
char hash_val[kTruncateSize];
|
||||
crypto::SHA256HashString(str, &hash_val[0], kTruncateSize);
|
||||
return StringToLowerASCII(base::HexEncode(&hash_val[0], kTruncateSize));
|
||||
return base::StringToLowerASCII(base::HexEncode(&hash_val[0], kTruncateSize));
|
||||
}
|
||||
|
||||
} // namespace signin_internals_util
|
||||
|
@ -99,7 +99,7 @@ bool MediaStorageUtil::HasDcim(const base::FilePath& mount_point) {
|
||||
if (!base::DirectoryExists(mount_point.Append(dcim_dir))) {
|
||||
// Check for lowercase 'dcim' as well.
|
||||
base::FilePath dcim_path_lower(
|
||||
mount_point.Append(StringToLowerASCII(dcim_dir)));
|
||||
mount_point.Append(base::StringToLowerASCII(dcim_dir)));
|
||||
if (!base::DirectoryExists(dcim_path_lower))
|
||||
return false;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ base::string16 GetPnpDeviceId(LPARAM data) {
|
||||
return base::string16();
|
||||
base::string16 device_id(dev_interface->dbcc_name);
|
||||
DCHECK(base::IsStringASCII(device_id));
|
||||
return StringToLowerASCII(device_id);
|
||||
return base::StringToLowerASCII(device_id);
|
||||
}
|
||||
|
||||
// Gets the friendly name of the device specified by the |pnp_device_id|. On
|
||||
|
@ -291,10 +291,10 @@ void CorrectLanguageCodeTypo(std::string* code) {
|
||||
// Change everything up to a dash to lower-case and everything after to upper.
|
||||
size_t dash_index = code->find('-');
|
||||
if (dash_index != std::string::npos) {
|
||||
*code = StringToLowerASCII(code->substr(0, dash_index)) +
|
||||
*code = base::StringToLowerASCII(code->substr(0, dash_index)) +
|
||||
StringToUpperASCII(code->substr(dash_index));
|
||||
} else {
|
||||
*code = StringToLowerASCII(*code);
|
||||
*code = base::StringToLowerASCII(*code);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ bool RegexSetMatcher::Match(const std::string& text,
|
||||
// FilteredRE2 expects lowercase for prefiltering, but we still
|
||||
// match case-sensitively.
|
||||
std::vector<RE2ID> atoms(FindSubstringMatches(
|
||||
StringToLowerASCII(text)));
|
||||
base::StringToLowerASCII(text)));
|
||||
|
||||
std::vector<RE2ID> re2_ids;
|
||||
filtered_re2_->AllMatches(text, atoms, &re2_ids);
|
||||
|
@ -2564,7 +2564,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_computedStyleForProperties(
|
||||
|
||||
for (unsigned short i = 0; i < num_style_properties; ++i) {
|
||||
base::string16 name = (LPCWSTR)style_properties[i];
|
||||
StringToLowerASCII(&name);
|
||||
base::StringToLowerASCII(&name);
|
||||
if (name == L"display") {
|
||||
base::string16 display = GetString16Attribute(
|
||||
ui::AX_ATTR_DISPLAY);
|
||||
|
@ -22,7 +22,7 @@ namespace {
|
||||
base::FilePath ConstructOriginPath(const base::FilePath& root_path,
|
||||
const GURL& origin) {
|
||||
std::string origin_hash = base::SHA1HashString(origin.spec());
|
||||
std::string origin_hash_hex = StringToLowerASCII(
|
||||
std::string origin_hash_hex = base::StringToLowerASCII(
|
||||
base::HexEncode(origin_hash.c_str(), origin_hash.length()));
|
||||
return root_path.AppendASCII(origin_hash_hex);
|
||||
}
|
||||
|
@ -201,9 +201,9 @@ WebFontDescription PPFontDescToWebFontDesc(
|
||||
// we should use the fixed or regular font size. It's difficult at this
|
||||
// level to detect if the requested font is fixed width, so we only apply
|
||||
// the alternate font size to the default fixed font family.
|
||||
if (StringToLowerASCII(resolved_family) ==
|
||||
StringToLowerASCII(GetFontFromMap(prefs.fixed_font_family_map,
|
||||
kCommonScript)))
|
||||
if (base::StringToLowerASCII(resolved_family) ==
|
||||
base::StringToLowerASCII(GetFontFromMap(prefs.fixed_font_family_map,
|
||||
kCommonScript)))
|
||||
result.size = static_cast<float>(prefs.default_fixed_font_size);
|
||||
else
|
||||
result.size = static_cast<float>(prefs.default_font_size);
|
||||
|
@ -259,7 +259,7 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name,
|
||||
static base::FilePath plugin_path =
|
||||
CommandLine::ForCurrentProcess()->GetSwitchValuePath(
|
||||
switches::kPluginPath);
|
||||
static std::wstring filename = StringToLowerASCII(
|
||||
static std::wstring filename = base::StringToLowerASCII(
|
||||
plugin_path.BaseName().value());
|
||||
static NPIdentifier fullscreen =
|
||||
WebBindings::getStringIdentifier("fullScreen");
|
||||
|
@ -275,7 +275,7 @@ bool PluginHost::SetPostData(const char* buf,
|
||||
break;
|
||||
case GETVALUE:
|
||||
// Got a header.
|
||||
name = StringToLowerASCII(std::string(start, ptr - start));
|
||||
name = base::StringToLowerASCII(std::string(start, ptr - start));
|
||||
base::TrimWhitespace(name, base::TRIM_ALL, &name);
|
||||
start = ptr + 1;
|
||||
break;
|
||||
|
@ -62,7 +62,7 @@ bool PluginStream::Open(const std::string& mime_type,
|
||||
|
||||
bool seekable_stream = false;
|
||||
if (request_is_seekable) {
|
||||
std::string headers_lc = StringToLowerASCII(headers);
|
||||
std::string headers_lc = base::StringToLowerASCII(headers);
|
||||
if (headers_lc.find("accept-ranges: bytes") != std::string::npos) {
|
||||
seekable_stream = true;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
|
||||
|
||||
const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info();
|
||||
std::wstring filename =
|
||||
StringToLowerASCII(plugin_info.path.BaseName().value());
|
||||
base::StringToLowerASCII(plugin_info.path.BaseName().value());
|
||||
|
||||
if (instance_->mime_type() == kFlashPluginSwfMimeType ||
|
||||
filename == kFlashPlugin) {
|
||||
|
@ -143,7 +143,7 @@ bool PluginList::ParseMimeTypes(
|
||||
|
||||
for (size_t i = 0; i < mime_types.size(); ++i) {
|
||||
WebPluginMimeType mime_type;
|
||||
mime_type.mime_type = StringToLowerASCII(mime_types[i]);
|
||||
mime_type.mime_type = base::StringToLowerASCII(mime_types[i]);
|
||||
if (file_extensions.size() > i)
|
||||
base::SplitString(file_extensions[i], ',', &mime_type.file_extensions);
|
||||
|
||||
@ -313,7 +313,7 @@ void PluginList::GetPluginInfoArray(
|
||||
bool include_npapi,
|
||||
std::vector<WebPluginInfo>* info,
|
||||
std::vector<std::string>* actual_mime_types) {
|
||||
DCHECK(mime_type == StringToLowerASCII(mime_type));
|
||||
DCHECK(mime_type == base::StringToLowerASCII(mime_type));
|
||||
DCHECK(info);
|
||||
|
||||
if (!use_stale)
|
||||
@ -348,7 +348,8 @@ void PluginList::GetPluginInfoArray(
|
||||
std::string path = url.path();
|
||||
std::string::size_type last_dot = path.rfind('.');
|
||||
if (last_dot != std::string::npos && mime_type.empty()) {
|
||||
std::string extension = StringToLowerASCII(std::string(path, last_dot+1));
|
||||
std::string extension =
|
||||
base::StringToLowerASCII(std::string(path, last_dot+1));
|
||||
std::string actual_mime_type;
|
||||
for (size_t i = 0; i < plugins_list_.size(); ++i) {
|
||||
if (SupportsExtension(plugins_list_[i], extension, &actual_mime_type)) {
|
||||
|
@ -384,9 +384,9 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
|
||||
if (should_check_version) {
|
||||
for (size_t j = 0; j < plugins->size(); ++j) {
|
||||
base::FilePath::StringType plugin1 =
|
||||
StringToLowerASCII((*plugins)[j].path.BaseName().value());
|
||||
base::StringToLowerASCII((*plugins)[j].path.BaseName().value());
|
||||
base::FilePath::StringType plugin2 =
|
||||
StringToLowerASCII(info.path.BaseName().value());
|
||||
base::StringToLowerASCII(info.path.BaseName().value());
|
||||
if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) ||
|
||||
(plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) ||
|
||||
(plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) {
|
||||
@ -413,7 +413,7 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
|
||||
|
||||
// Troublemakers.
|
||||
base::FilePath::StringType filename =
|
||||
StringToLowerASCII(info.path.BaseName().value());
|
||||
base::StringToLowerASCII(info.path.BaseName().value());
|
||||
// Depends on XPCOM.
|
||||
if (filename == kMozillaActiveXPlugin)
|
||||
return false;
|
||||
|
@ -24,7 +24,7 @@ std::string GetHMACForMediaDeviceID(const ResourceContext::SaltCallback& sc,
|
||||
bool result = hmac.Init(security_origin.spec()) &&
|
||||
hmac.Sign(raw_unique_id + salt, &digest[0], digest.size());
|
||||
DCHECK(result);
|
||||
return StringToLowerASCII(base::HexEncode(&digest[0], digest.size()));
|
||||
return base::StringToLowerASCII(base::HexEncode(&digest[0], digest.size()));
|
||||
}
|
||||
|
||||
bool DoesMediaDeviceIDMatchHMAC(const ResourceContext::SaltCallback& sc,
|
||||
|
@ -304,9 +304,9 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
|
||||
// a WebElement method that returns the original lower cased tagName.
|
||||
dst->AddStringAttribute(
|
||||
ui::AX_ATTR_HTML_TAG,
|
||||
StringToLowerASCII(UTF16ToUTF8(element.tagName())));
|
||||
base::StringToLowerASCII(UTF16ToUTF8(element.tagName())));
|
||||
for (unsigned i = 0; i < element.attributeCount(); ++i) {
|
||||
std::string name = StringToLowerASCII(UTF16ToUTF8(
|
||||
std::string name = base::StringToLowerASCII(UTF16ToUTF8(
|
||||
element.attributeLocalName(i)));
|
||||
std::string value = UTF16ToUTF8(element.attributeValue(i));
|
||||
dst->html_attributes.push_back(std::make_pair(name, value));
|
||||
|
@ -48,7 +48,7 @@ uint32 GetReasonsForUncacheability(const WebURLResponse& response) {
|
||||
|
||||
std::string cache_control_header =
|
||||
response.httpHeaderField("cache-control").utf8();
|
||||
StringToLowerASCII(&cache_control_header);
|
||||
base::StringToLowerASCII(&cache_control_header);
|
||||
if (cache_control_header.find("no-cache") != std::string::npos)
|
||||
reasons |= kNoCache;
|
||||
if (cache_control_header.find("no-store") != std::string::npos)
|
||||
|
@ -547,7 +547,7 @@ WebPluginImpl::WebPluginImpl(
|
||||
weak_factory_(this),
|
||||
loader_client_(this) {
|
||||
DCHECK_EQ(params.attributeNames.size(), params.attributeValues.size());
|
||||
StringToLowerASCII(&mime_type_);
|
||||
base::StringToLowerASCII(&mime_type_);
|
||||
|
||||
for (size_t i = 0; i < params.attributeNames.size(); ++i) {
|
||||
arg_names_.push_back(params.attributeNames[i].utf8());
|
||||
|
@ -212,7 +212,7 @@ ShellContentBrowserClient::CreateRequestContextForStoragePartition(
|
||||
bool ShellContentBrowserClient::IsHandledURL(const GURL& url) {
|
||||
if (!url.is_valid())
|
||||
return false;
|
||||
DCHECK_EQ(url.scheme(), StringToLowerASCII(url.scheme()));
|
||||
DCHECK_EQ(url.scheme(), base::StringToLowerASCII(url.scheme()));
|
||||
// Keep in sync with ProtocolHandlers added by
|
||||
// ShellURLRequestContextGetter::GetURLRequestContext().
|
||||
static const char* const kProtocolList[] = {
|
||||
|
@ -481,7 +481,7 @@ std::string WebKitTestRunner::pathToLocalResource(const std::string& resource) {
|
||||
// Some layout tests use file://// which we resolve as a UNC path. Normalize
|
||||
// them to just file:///.
|
||||
std::string result = resource;
|
||||
while (StringToLowerASCII(result).find("file:////") == 0) {
|
||||
while (base::StringToLowerASCII(result).find("file:////") == 0) {
|
||||
result = result.substr(0, strlen("file:///")) +
|
||||
result.substr(strlen("file:////"));
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ TEST_P(SymmetricKeyDeriveKeyFromPasswordTest, DeriveKeyFromPassword) {
|
||||
key->GetRawKey(&raw_key);
|
||||
EXPECT_EQ(test_data.key_size_in_bits / 8, raw_key.size());
|
||||
EXPECT_EQ(test_data.expected,
|
||||
StringToLowerASCII(base::HexEncode(raw_key.data(),
|
||||
base::StringToLowerASCII(base::HexEncode(raw_key.data(),
|
||||
raw_key.size())));
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension,
|
||||
|
||||
const Extension* ExtensionRegistry::GetExtensionById(const std::string& id,
|
||||
int include_mask) const {
|
||||
std::string lowercase_id = StringToLowerASCII(id);
|
||||
std::string lowercase_id = base::StringToLowerASCII(id);
|
||||
if (include_mask & ENABLED) {
|
||||
const Extension* extension = enabled_extensions_.GetByID(lowercase_id);
|
||||
if (extension)
|
||||
|
@ -42,7 +42,7 @@ bool HasOnlySecureTokens(base::StringTokenizer& tokenizer,
|
||||
Manifest::Type type) {
|
||||
while (tokenizer.GetNext()) {
|
||||
std::string source = tokenizer.token();
|
||||
StringToLowerASCII(&source);
|
||||
base::StringToLowerASCII(&source);
|
||||
|
||||
// Don't alow whitelisting of all hosts. This boils down to:
|
||||
// 1. Maximum of 2 '*' characters.
|
||||
@ -136,7 +136,7 @@ bool ContentSecurityPolicyIsSecure(const std::string& policy,
|
||||
continue;
|
||||
|
||||
std::string directive_name = tokenizer.token();
|
||||
StringToLowerASCII(&directive_name);
|
||||
base::StringToLowerASCII(&directive_name);
|
||||
|
||||
if (UpdateStatus(directive_name, tokenizer, &default_src_status, type))
|
||||
continue;
|
||||
@ -176,7 +176,7 @@ bool ContentSecurityPolicyIsSandboxed(
|
||||
continue;
|
||||
|
||||
std::string directive_name = tokenizer.token();
|
||||
StringToLowerASCII(&directive_name);
|
||||
base::StringToLowerASCII(&directive_name);
|
||||
|
||||
if (directive_name != kSandboxDirectiveName)
|
||||
continue;
|
||||
@ -185,7 +185,7 @@ bool ContentSecurityPolicyIsSandboxed(
|
||||
|
||||
while (tokenizer.GetNext()) {
|
||||
std::string token = tokenizer.token();
|
||||
StringToLowerASCII(&token);
|
||||
base::StringToLowerASCII(&token);
|
||||
|
||||
// The same origin token negates the sandboxing.
|
||||
if (token == kAllowSameOriginToken)
|
||||
|
@ -141,7 +141,7 @@ bool Extension::IdIsValid(const std::string& id) {
|
||||
|
||||
// We only support lowercase IDs, because IDs can be used as URL components
|
||||
// (where GURL will lowercase it).
|
||||
std::string temp = StringToLowerASCII(id);
|
||||
std::string temp = base::StringToLowerASCII(id);
|
||||
for (size_t i = 0; i < temp.size(); i++)
|
||||
if (temp[i] < 'a' || temp[i] > 'p')
|
||||
return false;
|
||||
|
@ -39,7 +39,8 @@ const size_t kIdSize = 16;
|
||||
std::string GenerateId(const std::string& input) {
|
||||
uint8 hash[kIdSize];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
std::string output = StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
std::string output =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
ConvertHexadecimalToIDAlphabet(&output);
|
||||
|
||||
return output;
|
||||
|
@ -76,7 +76,7 @@ bool MessageBundle::Init(const CatalogVector& locale_catalogs,
|
||||
base::DictionaryValue* catalog = (*it).get();
|
||||
for (base::DictionaryValue::Iterator message_it(*catalog);
|
||||
!message_it.IsAtEnd(); message_it.Advance()) {
|
||||
std::string key(StringToLowerASCII(message_it.key()));
|
||||
std::string key(base::StringToLowerASCII(message_it.key()));
|
||||
if (!IsValidName(message_it.key()))
|
||||
return BadKeyMessage(key, error);
|
||||
std::string value;
|
||||
@ -191,7 +191,7 @@ bool MessageBundle::GetPlaceholders(const base::DictionaryValue& name_tree,
|
||||
kContentKey, name_key.c_str());
|
||||
return false;
|
||||
}
|
||||
(*placeholders)[StringToLowerASCII(content_key)] = content;
|
||||
(*placeholders)[base::StringToLowerASCII(content_key)] = content;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -250,7 +250,7 @@ bool MessageBundle::ReplaceVariables(const SubstitutionMap& variables,
|
||||
if (!IsValidName(var_name))
|
||||
continue;
|
||||
SubstitutionMap::const_iterator it =
|
||||
variables.find(StringToLowerASCII(var_name));
|
||||
variables.find(base::StringToLowerASCII(var_name));
|
||||
if (it == variables.end()) {
|
||||
*error = base::StringPrintf("Variable %s%s%s used but not defined.",
|
||||
var_begin_delimiter.c_str(),
|
||||
@ -298,7 +298,7 @@ std::string MessageBundle::GetL10nMessage(const std::string& name) const {
|
||||
std::string MessageBundle::GetL10nMessage(const std::string& name,
|
||||
const SubstitutionMap& dictionary) {
|
||||
SubstitutionMap::const_iterator it =
|
||||
dictionary.find(StringToLowerASCII(name));
|
||||
dictionary.find(base::StringToLowerASCII(name));
|
||||
if (it != dictionary.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ bool SocketPermissionEntry::Check(
|
||||
if (pattern_.type != request.type)
|
||||
return false;
|
||||
|
||||
std::string lhost = StringToLowerASCII(request.host);
|
||||
std::string lhost = base::StringToLowerASCII(request.host);
|
||||
if (pattern_.host != lhost) {
|
||||
if (!match_subdomains_)
|
||||
return false;
|
||||
@ -165,7 +165,7 @@ bool SocketPermissionEntry::ParseHostPattern(
|
||||
if (!result.pattern_.host.empty()) {
|
||||
if (StartsOrEndsWithWhitespace(result.pattern_.host))
|
||||
return false;
|
||||
result.pattern_.host = StringToLowerASCII(result.pattern_.host);
|
||||
result.pattern_.host = base::StringToLowerASCII(result.pattern_.host);
|
||||
|
||||
// The first component can optionally be '*' to match all subdomains.
|
||||
std::vector<std::string> host_components;
|
||||
|
@ -35,7 +35,7 @@ std::string CanonicalizeEmailImpl(const std::string& email_address,
|
||||
base::RemoveChars(parts[0], ".", &parts[0]);
|
||||
}
|
||||
|
||||
std::string new_email = StringToLowerASCII(JoinString(parts, at));
|
||||
std::string new_email = base::StringToLowerASCII(JoinString(parts, at));
|
||||
VLOG(1) << "Canonicalized " << email_address << " to " << new_email;
|
||||
return new_email;
|
||||
}
|
||||
@ -53,7 +53,7 @@ std::string CanonicalizeEmail(const std::string& email_address) {
|
||||
std::string CanonicalizeDomain(const std::string& domain) {
|
||||
// Canonicalization of domain names means lower-casing them. Make sure to
|
||||
// update this function in sync with Canonicalize if this ever changes.
|
||||
return StringToLowerASCII(domain);
|
||||
return base::StringToLowerASCII(domain);
|
||||
}
|
||||
|
||||
std::string SanitizeEmail(const std::string& email_address) {
|
||||
|
@ -196,7 +196,7 @@ std::string GServicesSettings::CalculateDigest(const SettingsMap& settings) {
|
||||
reinterpret_cast<const unsigned char*>(&data[0]), data.size(), hash);
|
||||
std::string digest =
|
||||
kDigestVersionPrefix + base::HexEncode(hash, base::kSHA1Length);
|
||||
digest = StringToLowerASCII(digest);
|
||||
digest = base::StringToLowerASCII(digest);
|
||||
return digest;
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
const char* version_str =
|
||||
reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||
if (version_str) {
|
||||
std::string lstr(StringToLowerASCII(std::string(version_str)));
|
||||
std::string lstr(base::StringToLowerASCII(std::string(version_str)));
|
||||
is_es3 = (lstr.substr(0, 12) == "opengl es 3.");
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
|
||||
SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version);
|
||||
|
||||
std::string l_version(StringToLowerASCII(std::string(gl_version)));
|
||||
std::string l_version(base::StringToLowerASCII(std::string(gl_version)));
|
||||
bool is_es3 = (l_version.substr(0, 12) == "opengl es 3.");
|
||||
|
||||
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _))
|
||||
@ -319,7 +319,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
||||
.WillOnce(Return(reinterpret_cast<const uint8*>(gl_version)))
|
||||
.RetiresOnSaturation();
|
||||
|
||||
std::string l_version(StringToLowerASCII(std::string(gl_version)));
|
||||
std::string l_version(base::StringToLowerASCII(std::string(gl_version)));
|
||||
bool is_es3 = (l_version.substr(0, 12) == "opengl es 3.");
|
||||
|
||||
if (strstr(extensions, "GL_ARB_texture_float") ||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user