Replace ToLower calls to the new format
Replaces base::StringToLowerASCII(string) with base::ToLowerASCII(string) This form is 1:1 search and replace. A bunch of places did something like this: std::string foo(something_else); base::StringToLowerASCII(&foo); which became: foo = base::ToLowerASCII(something_else); A couple places really wanted in-place changing and they became: foo = base::ToLowerASCII(foo); There was pretty trivial cleanup in chrome_main_delegate.cc chrome/test/chromedriver/server/http_handler.cc (fix indenting). There was more cleanup in: chrome/installer/util/language_selector.cc and components/plugins/renderer/mobile_youtube_plugin.cc In components/history/core/browser/url_utils.cc I removed the call since it was calling ToLower on the host name out of a GURL, which is already guaranteed to be lower-case. NOPRESUBMIT=true (due to touching code with wstrings) Review URL: https://codereview.chromium.org/1279123004 Cr-Commit-Position: refs/heads/master@{#342659}
This commit is contained in:
android_webview/browser
base
chrome
app
browser
chromeos
customization
file_manager
login
power
settings
component_updater
enumerate_modules_model_win.ccextensions
file_select_helper.ccicon_loader_chromeos.ccimporter
install_verification
media_galleries
fileapi
profile_resetter
profiles
renderer_host
pepper
safe_browsing
incident_reporting
search
shell_integration_win.ccspellchecker
ui
webui
extensions
common
custom_handlers
extensions
api
file_browser_handlers
importer
installer
renderer
pepper
plugins
safe_browsing
test
chromedriver
chromeos
cloud_print/gcp20/prototype
components
audio_modem
autofill
content
browser
wallet
core
content_settings
core
crx_file
device_event_log
history
core
browser
language_usage_metrics
mime_util
nacl
os_crypt
plugins
renderer
policy
core
common
query_parser
signin
core
browser
storage_monitor
user_prefs
tracked
@ -118,7 +118,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 (base::StringToLowerASCII(langs) != "en-us") {
|
||||
if (base::ToLowerASCII(langs) != "en-us") {
|
||||
langs += ",en-US";
|
||||
}
|
||||
return langs;
|
||||
|
@ -267,7 +267,7 @@ void CommandLine::SetProgram(const FilePath& program) {
|
||||
}
|
||||
|
||||
bool CommandLine::HasSwitch(const base::StringPiece& switch_string) const {
|
||||
DCHECK_EQ(StringToLowerASCII(switch_string.as_string()), switch_string);
|
||||
DCHECK_EQ(ToLowerASCII(switch_string), switch_string);
|
||||
return switches_by_stringpiece_.find(switch_string) !=
|
||||
switches_by_stringpiece_.end();
|
||||
}
|
||||
@ -297,7 +297,7 @@ FilePath CommandLine::GetSwitchValuePath(
|
||||
|
||||
CommandLine::StringType CommandLine::GetSwitchValueNative(
|
||||
const base::StringPiece& switch_string) const {
|
||||
DCHECK_EQ(StringToLowerASCII(switch_string.as_string()), switch_string);
|
||||
DCHECK_EQ(ToLowerASCII(switch_string), switch_string);
|
||||
auto result = switches_by_stringpiece_.find(switch_string);
|
||||
return result == switches_by_stringpiece_.end() ? StringType()
|
||||
: *(result->second);
|
||||
@ -315,7 +315,7 @@ void CommandLine::AppendSwitchPath(const std::string& switch_string,
|
||||
void CommandLine::AppendSwitchNative(const std::string& switch_string,
|
||||
const CommandLine::StringType& value) {
|
||||
#if defined(OS_WIN)
|
||||
const std::string switch_key = StringToLowerASCII(switch_string);
|
||||
const std::string switch_key = ToLowerASCII(switch_string);
|
||||
StringType combined_switch_string(ASCIIToUTF16(switch_key));
|
||||
#elif defined(OS_POSIX)
|
||||
const std::string& switch_key = switch_string;
|
||||
|
@ -36,11 +36,8 @@ std::string GetLocaleString(const icu::Locale& locale) {
|
||||
result += country;
|
||||
}
|
||||
|
||||
if (variant != NULL && *variant != '\0') {
|
||||
std::string variant_str(variant);
|
||||
base::StringToLowerASCII(&variant_str);
|
||||
result += '@' + variant_str;
|
||||
}
|
||||
if (variant != NULL && *variant != '\0')
|
||||
result += '@' + base::ToLowerASCII(variant);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -152,13 +152,11 @@ namespace {
|
||||
// Early versions of Chrome incorrectly registered a chromehtml: URL handler,
|
||||
// which gives us nothing but trouble. Avoid launching chrome this way since
|
||||
// some apps fail to properly escape arguments.
|
||||
bool HasDeprecatedArguments(const std::wstring& command_line) {
|
||||
bool HasDeprecatedArguments(const base::string16& command_line) {
|
||||
const wchar_t kChromeHtml[] = L"chromehtml:";
|
||||
std::wstring command_line_lower = command_line;
|
||||
base::string16 command_line_lower = base::ToLowerASCII(command_line);
|
||||
// We are only searching for ASCII characters so this is OK.
|
||||
base::StringToLowerASCII(&command_line_lower);
|
||||
std::wstring::size_type pos = command_line_lower.find(kChromeHtml);
|
||||
return (pos != std::wstring::npos);
|
||||
return (command_line_lower.find(kChromeHtml) != base::string16::npos);
|
||||
}
|
||||
|
||||
// If we try to access a path that is not currently available, we want the call
|
||||
|
@ -39,8 +39,7 @@ bool ExtractPublicKeyHash(const CERT_CONTEXT* cert_context,
|
||||
crypt_blob.pbData), crypt_blob.cbData);
|
||||
crypto::SHA256HashString(key_bytes, hash, crypto::kSHA256Length);
|
||||
|
||||
*public_key_hash =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
*public_key_hash = base::ToLowerASCII(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 =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
base::ToLowerASCII(base::HexEncode(hash, arraysize(hash)));
|
||||
expected_hashes_.push_back(public_key_hash);
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ void ServicesCustomizationDocument::StartFetching() {
|
||||
&customization_id) &&
|
||||
!customization_id.empty()) {
|
||||
url_ = GURL(base::StringPrintf(
|
||||
kManifestUrl, base::StringToLowerASCII(customization_id).c_str()));
|
||||
kManifestUrl, base::ToLowerASCII(customization_id).c_str()));
|
||||
} else {
|
||||
// Remember that there is no customization ID in VPD.
|
||||
OnCustomizationNotFound();
|
||||
|
@ -169,7 +169,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 = base::StringToLowerASCII(*iter);
|
||||
std::string lower_suffix = base::ToLowerASCII(*iter);
|
||||
mime_type_pref->SetWithoutPathExpansion(lower_suffix, value);
|
||||
}
|
||||
}
|
||||
@ -197,7 +197,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 = base::StringToLowerASCII(suffix);
|
||||
std::string lower_suffix = base::ToLowerASCII(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;
|
||||
|
@ -1145,7 +1145,7 @@ void UserSessionManager::InitializeStartUrls() const {
|
||||
const char* url = kChromeVoxTutorialURLPattern;
|
||||
PrefService* prefs = g_browser_process->local_state();
|
||||
const std::string current_locale =
|
||||
base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale));
|
||||
base::ToLowerASCII(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,9 +40,8 @@ const int kMasterKeySize = 32;
|
||||
std::string CreateSalt() {
|
||||
char result[kSaltSize];
|
||||
crypto::RandBytes(&result, sizeof(result));
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(result),
|
||||
sizeof(result)));
|
||||
return base::ToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(result), sizeof(result)));
|
||||
}
|
||||
|
||||
std::string BuildRawHMACKey() {
|
||||
@ -164,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 base::StringToLowerASCII(
|
||||
return base::ToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(master_key_bytes),
|
||||
sizeof(master_key_bytes)));
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ std::string ExtractBluetoothAddress(const std::string& path) {
|
||||
int key_len = path.size() - header_size - end_size;
|
||||
if (key_len <= 0)
|
||||
return std::string();
|
||||
std::string reverse_address = path.substr(header_size, key_len);
|
||||
base::StringToLowerASCII(&reverse_address);
|
||||
std::string reverse_address =
|
||||
base::ToLowerASCII(path.substr(header_size, key_len));
|
||||
std::vector<std::string> result = base::SplitString(
|
||||
reverse_address, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
||||
std::reverse(result.begin(), result.end());
|
||||
@ -181,8 +181,7 @@ void PeripheralBatteryObserver::InitializeOnBluetoothReady(
|
||||
|
||||
void PeripheralBatteryObserver::RemoveBattery(const std::string& address) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
std::string address_lowercase = address;
|
||||
base::StringToLowerASCII(&address_lowercase);
|
||||
std::string address_lowercase = base::ToLowerASCII(address);
|
||||
std::map<std::string, BatteryInfo>::iterator it =
|
||||
batteries_.find(address_lowercase);
|
||||
if (it != batteries_.end()) {
|
||||
|
@ -88,9 +88,9 @@ std::string CryptohomeTokenEncryptor::EncryptTokenWithKey(
|
||||
return std::string();
|
||||
}
|
||||
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(encoded_token.data()),
|
||||
encoded_token.size()));
|
||||
return base::ToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(encoded_token.data()),
|
||||
encoded_token.size()));
|
||||
}
|
||||
|
||||
std::string CryptohomeTokenEncryptor::DecryptTokenWithKey(
|
||||
|
@ -259,7 +259,7 @@ TEST_F(SupervisedUserWhitelistInstallerTest, GetHashFromCrxId) {
|
||||
|
||||
{
|
||||
std::string extension_id = "aBcDeFgHiJkLmNoPpOnMlKjIhGfEdCbA";
|
||||
ASSERT_EQ(base::StringToLowerASCII(extension_id),
|
||||
ASSERT_EQ(base::ToLowerASCII(extension_id),
|
||||
CrxIdToHashToCrxId(extension_id));
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ static void GenerateHash(const std::string& input, std::string* output) {
|
||||
|
||||
uint8 hash[4];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
*output = base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
*output = base::ToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -151,8 +151,7 @@ bool GetFileTypesFromAcceptOption(
|
||||
for (std::vector<std::string>::const_iterator iter = list->begin();
|
||||
iter != list->end(); ++iter) {
|
||||
std::vector<base::FilePath::StringType> inner;
|
||||
std::string accept_type = *iter;
|
||||
base::StringToLowerASCII(&accept_type);
|
||||
std::string accept_type = base::ToLowerASCII(*iter);
|
||||
net::GetExtensionsForMimeType(accept_type, &inner);
|
||||
if (inner.empty())
|
||||
continue;
|
||||
@ -176,8 +175,7 @@ bool GetFileTypesFromAcceptOption(
|
||||
std::vector<std::string>* list = accept_option.extensions.get();
|
||||
for (std::vector<std::string>::const_iterator iter = list->begin();
|
||||
iter != list->end(); ++iter) {
|
||||
std::string extension = *iter;
|
||||
base::StringToLowerASCII(&extension);
|
||||
std::string extension = base::ToLowerASCII(*iter);
|
||||
#if defined(OS_WIN)
|
||||
extension_set.insert(base::UTF8ToWide(*iter));
|
||||
#else
|
||||
|
@ -67,7 +67,7 @@ const char* GcmResultToError(gcm::GCMClient::Result result) {
|
||||
}
|
||||
|
||||
bool IsMessageKeyValid(const std::string& key) {
|
||||
std::string lower = base::StringToLowerASCII(key);
|
||||
std::string lower = base::ToLowerASCII(key);
|
||||
return !key.empty() &&
|
||||
key.compare(0, arraysize(kCollapseKey) - 1, kCollapseKey) != 0 &&
|
||||
lower.compare(0,
|
||||
|
@ -24,7 +24,7 @@ bool ComputeHmacSha256(const std::string& key,
|
||||
bool result = hmac.Init(key) &&
|
||||
hmac.Sign(text, &digest[0], digest.size());
|
||||
if (result) {
|
||||
*signature_return = base::StringToLowerASCII(
|
||||
*signature_return = base::ToLowerASCII(
|
||||
base::HexEncode(digest.data(), digest.size()));
|
||||
}
|
||||
return result;
|
||||
|
@ -124,7 +124,7 @@ class MacAddressProcessor {
|
||||
|
||||
// Got one!
|
||||
found_mac_address_ =
|
||||
base::StringToLowerASCII(base::HexEncode(mac_address, MAC_LENGTH));
|
||||
base::ToLowerASCII(base::HexEncode(mac_address, MAC_LENGTH));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class MacAddressProcessor {
|
||||
if (!is_valid_mac_address_.Run(mac_address, mac_address_size))
|
||||
return keep_going;
|
||||
|
||||
std::string mac_address_string = base::StringToLowerASCII(base::HexEncode(
|
||||
std::string mac_address_string = base::ToLowerASCII(base::HexEncode(
|
||||
mac_address, mac_address_size));
|
||||
|
||||
base::ScopedCFTypeRef<CFStringRef> provider_class(
|
||||
|
@ -76,7 +76,7 @@ class MacAddressProcessor {
|
||||
if (!is_valid_mac_address_.Run(bytes, size))
|
||||
return;
|
||||
|
||||
found_mac_address_ = base::StringToLowerASCII(base::HexEncode(bytes, size));
|
||||
found_mac_address_ = base::ToLowerASCII(base::HexEncode(bytes, size));
|
||||
found_index_ = index;
|
||||
}
|
||||
|
||||
|
@ -2116,7 +2116,7 @@ void ExtensionService::TerminateExtension(const std::string& extension_id) {
|
||||
}
|
||||
|
||||
void ExtensionService::UntrackTerminatedExtension(const std::string& id) {
|
||||
std::string lowercase_id = base::StringToLowerASCII(id);
|
||||
std::string lowercase_id = base::ToLowerASCII(id);
|
||||
const Extension* extension =
|
||||
registry_->terminated_extensions().GetByID(lowercase_id);
|
||||
registry_->RemoveTerminated(lowercase_id);
|
||||
|
@ -98,8 +98,7 @@ void ExternalRegistryLoader::LoadOnFileThread() {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string id = base::UTF16ToASCII(*it);
|
||||
base::StringToLowerASCII(&id);
|
||||
std::string id = base::ToLowerASCII(base::UTF16ToASCII(*it));
|
||||
if (!crx_file::id_util::IdIsValid(id)) {
|
||||
LOG(ERROR) << "Invalid id value " << id
|
||||
<< " for key " << key_path << ".";
|
||||
|
@ -75,7 +75,7 @@ LocalExtensionCache::CacheMap::iterator LocalExtensionCache::FindExtension(
|
||||
const std::string& expected_hash) {
|
||||
CacheHit hit = cache.equal_range(id);
|
||||
CacheMap::iterator empty_hash = cache.end();
|
||||
std::string hash = base::StringToLowerASCII(expected_hash);
|
||||
std::string hash = base::ToLowerASCII(expected_hash);
|
||||
for (CacheMap::iterator it = hit.first; it != hit.second; ++it) {
|
||||
if (expected_hash.empty() || it->second.expected_hash == hash) {
|
||||
return it;
|
||||
@ -437,7 +437,7 @@ void LocalExtensionCache::BackendCheckCacheContentsInternal(
|
||||
}
|
||||
|
||||
// Enforce a lower-case id.
|
||||
id = base::StringToLowerASCII(id);
|
||||
id = base::ToLowerASCII(id);
|
||||
if (!crx_file::id_util::IdIsValid(id)) {
|
||||
LOG(ERROR) << "Bad extension id in cache: " << id;
|
||||
id.clear();
|
||||
@ -486,7 +486,7 @@ std::string LocalExtensionCache::ExtensionFileName(
|
||||
const std::string& expected_hash) {
|
||||
std::string filename = id + "-" + version;
|
||||
if (!expected_hash.empty())
|
||||
filename += "-" + base::StringToLowerASCII(expected_hash);
|
||||
filename += "-" + base::ToLowerASCII(expected_hash);
|
||||
filename += kCRXFileExtension;
|
||||
return filename;
|
||||
}
|
||||
@ -612,7 +612,7 @@ LocalExtensionCache::CacheItemInfo::CacheItemInfo(
|
||||
uint64 size,
|
||||
const base::FilePath& file_path)
|
||||
: version(version),
|
||||
expected_hash(base::StringToLowerASCII(expected_hash)),
|
||||
expected_hash(base::ToLowerASCII(expected_hash)),
|
||||
last_used(last_used),
|
||||
size(size),
|
||||
file_path(file_path) {
|
||||
|
@ -105,7 +105,7 @@ class LocalExtensionCacheTest : public testing::Test {
|
||||
uint8 output[crypto::kSHA256Length];
|
||||
hash->Finish(output, sizeof(output));
|
||||
const std::string hex_hash =
|
||||
base::StringToLowerASCII(base::HexEncode(output, sizeof(output)));
|
||||
base::ToLowerASCII(base::HexEncode(output, sizeof(output)));
|
||||
delete hash;
|
||||
|
||||
const base::FilePath file =
|
||||
|
@ -565,7 +565,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 ||
|
||||
base::StringToLowerASCII(accept_type) != accept_type ||
|
||||
base::ToLowerASCII(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 base::StringToLowerASCII(filepath.Extension());
|
||||
return base::ToLowerASCII(filepath.Extension());
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -78,7 +78,7 @@ class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter {
|
||||
// TemplateURLParser::ParameterFilter method.
|
||||
bool KeepParameter(const std::string& key,
|
||||
const std::string& value) override {
|
||||
std::string low_value = base::StringToLowerASCII(value);
|
||||
std::string low_value = base::ToLowerASCII(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(base::StringToLowerASCII(base::UTF16ToUTF8(
|
||||
return base::MD5String(base::ToLowerASCII(base::UTF16ToUTF8(
|
||||
base::FilePath(module_name).BaseName().value())));
|
||||
}
|
||||
|
||||
|
@ -152,8 +152,7 @@ bool MediaPathFilter::Match(const base::FilePath& path) {
|
||||
MediaGalleryScanFileType MediaPathFilter::GetType(const base::FilePath& path) {
|
||||
EnsureInitialized();
|
||||
MediaFileExtensionMap::const_iterator it =
|
||||
media_file_extensions_map_.find(
|
||||
base::StringToLowerASCII(path.Extension()));
|
||||
media_file_extensions_map_.find(base::ToLowerASCII(path.Extension()));
|
||||
if (it == media_file_extensions_map_.end())
|
||||
return MEDIA_GALLERY_SCAN_FILE_TYPE_UNKNOWN;
|
||||
return static_cast<MediaGalleryScanFileType>(it->second);
|
||||
|
@ -113,7 +113,7 @@ void ExtractLoadedModuleNameDigests(
|
||||
std::string module_name;
|
||||
if (!module_dictionary->GetString("name", &module_name))
|
||||
continue;
|
||||
base::StringToLowerASCII(&module_name);
|
||||
module_name = base::ToLowerASCII(module_name);
|
||||
module_name_digests->AppendString(base::MD5String(module_name));
|
||||
}
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ ProfileIOData* ProfileIOData::FromResourceContext(
|
||||
|
||||
// static
|
||||
bool ProfileIOData::IsHandledProtocol(const std::string& scheme) {
|
||||
DCHECK_EQ(scheme, base::StringToLowerASCII(scheme));
|
||||
DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
|
||||
static const char* const kProtocolList[] = {
|
||||
url::kFileScheme,
|
||||
content::kChromeDevToolsScheme,
|
||||
|
@ -159,13 +159,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 = base::StringToLowerASCII(
|
||||
std::string id = base::ToLowerASCII(
|
||||
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 = base::StringToLowerASCII(
|
||||
id = base::ToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(id_buf), sizeof(id_buf)));
|
||||
|
||||
RunCallbackOnIOThread(id, PP_OK);
|
||||
|
@ -34,7 +34,7 @@ bool GetLoadedBlacklistedModules(std::vector<base::string16>* module_names) {
|
||||
|
||||
std::set<ModuleInfo>::const_iterator module_iter(module_info_set.begin());
|
||||
for (; module_iter != module_info_set.end(); ++module_iter) {
|
||||
base::string16 module_file_name(base::StringToLowerASCII(
|
||||
base::string16 module_file_name(base::ToLowerASCII(
|
||||
base::FilePath(module_iter->name).BaseName().value()));
|
||||
if (blacklist::GetBlacklistIndex(module_file_name.c_str()) != -1) {
|
||||
module_names->push_back(module_iter->name);
|
||||
|
@ -44,7 +44,7 @@ TEST(BlacklistLoadAnalyzer, TestBlacklistBypass) {
|
||||
EXPECT_TRUE(GetLoadedBlacklistedModules(&module_names));
|
||||
ASSERT_EQ(1, module_names.size());
|
||||
EXPECT_STREQ(kTestDllName,
|
||||
base::StringToLowerASCII(
|
||||
base::ToLowerASCII(
|
||||
base::FilePath(module_names[0]).BaseName().value()).c_str());
|
||||
}
|
||||
|
||||
|
@ -268,8 +268,7 @@ class HotwordNotificationDelegate : public NotificationDelegate {
|
||||
// static
|
||||
bool HotwordService::DoesHotwordSupportLanguage(Profile* profile) {
|
||||
std::string normalized_locale =
|
||||
l10n_util::NormalizeLocale(GetCurrentLocale(profile));
|
||||
base::StringToLowerASCII(&normalized_locale);
|
||||
base::ToLowerASCII(l10n_util::NormalizeLocale(GetCurrentLocale(profile)));
|
||||
|
||||
// For M43, we are limiting always-on to en_us only.
|
||||
// TODO(kcarattini): Remove this once
|
||||
|
@ -386,7 +386,7 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() {
|
||||
base::string16 app_cmd;
|
||||
if (key.Valid() && (key.ReadValue(L"", &app_cmd) == ERROR_SUCCESS) &&
|
||||
base::string16::npos !=
|
||||
base::StringToLowerASCII(app_cmd).find(L"firefox"))
|
||||
base::ToLowerASCII(app_cmd).find(L"firefox"))
|
||||
ff_default = true;
|
||||
}
|
||||
return ff_default;
|
||||
|
@ -228,7 +228,7 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
DCHECK(!bdict_file.empty());
|
||||
|
||||
return GURL(std::string(kDownloadServerUrl) +
|
||||
base::StringToLowerASCII(bdict_file));
|
||||
base::ToLowerASCII(bdict_file));
|
||||
}
|
||||
|
||||
void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
|
||||
|
@ -277,7 +277,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 = base::StringToLowerASCII(path);
|
||||
std::string path_lower = base::ToLowerASCII(path);
|
||||
std::vector<std::string> path_parts = base::SplitString(
|
||||
path_lower, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
||||
if (path_lower.empty() || path_parts.size() < 3)
|
||||
|
@ -18,7 +18,7 @@ ProtocolHandler::ProtocolHandler(const std::string& protocol,
|
||||
ProtocolHandler ProtocolHandler::CreateProtocolHandler(
|
||||
const std::string& protocol,
|
||||
const GURL& url) {
|
||||
std::string lower_protocol = base::StringToLowerASCII(protocol);
|
||||
std::string lower_protocol = base::ToLowerASCII(protocol);
|
||||
return ProtocolHandler(lower_protocol, url);
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ FileBrowserHandler* LoadFileBrowserHandler(
|
||||
errors::kInvalidFileFilterValue, base::IntToString(i));
|
||||
return NULL;
|
||||
}
|
||||
base::StringToLowerASCII(&filter);
|
||||
filter = base::ToLowerASCII(filter);
|
||||
if (!base::StartsWith(filter, std::string(url::kFileSystemScheme) + ':',
|
||||
base::CompareCase::SENSITIVE)) {
|
||||
*error = extensions::ErrorUtils::FormatErrorMessageUTF16(
|
||||
|
@ -319,7 +319,7 @@ base::string16 GetFirefoxImporterName(const base::FilePath& app_path) {
|
||||
}
|
||||
}
|
||||
|
||||
base::StringToLowerASCII(&branding_name);
|
||||
branding_name = base::ToLowerASCII(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);
|
||||
|
@ -243,13 +243,9 @@ bool LanguageSelector::SelectIf(const std::vector<std::wstring>& candidates,
|
||||
SelectPred_Fn select_predicate,
|
||||
std::wstring* matched_name,
|
||||
int* matched_offset) {
|
||||
std::wstring candidate;
|
||||
for (std::vector<std::wstring>::const_iterator scan = candidates.begin(),
|
||||
end = candidates.end(); scan != end; ++scan) {
|
||||
candidate.assign(*scan);
|
||||
base::StringToLowerASCII(&candidate);
|
||||
if (select_predicate(candidate, matched_offset)) {
|
||||
matched_name->assign(*scan);
|
||||
for (const std::wstring& scan : candidates) {
|
||||
if (select_predicate(base::ToLowerASCII(scan), matched_offset)) {
|
||||
matched_name->assign(scan);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ int32_t PepperFlashRendererHost::OnNavigate(
|
||||
bool rejected = false;
|
||||
while (header_iter.GetNext()) {
|
||||
std::string lower_case_header_name =
|
||||
base::StringToLowerASCII(header_iter.name());
|
||||
base::ToLowerASCII(header_iter.name());
|
||||
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
|
||||
rejected = true;
|
||||
|
||||
|
@ -106,7 +106,7 @@ void PluginUMAReporter::ExtractFileExtension(const GURL& src,
|
||||
extension->clear();
|
||||
}
|
||||
|
||||
base::StringToLowerASCII(extension);
|
||||
*extension = base::ToLowerASCII(*extension);
|
||||
}
|
||||
|
||||
PluginUMAReporter::PluginType PluginUMAReporter::GetPluginType(
|
||||
@ -115,7 +115,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(base::StringToLowerASCII(plugin_mime_type));
|
||||
return MimeTypeToPluginType(base::ToLowerASCII(plugin_mime_type));
|
||||
|
||||
return SrcToPluginType(plugin_src);
|
||||
}
|
||||
|
@ -327,8 +327,7 @@ void PhishingDOMFeatureExtractor::HandleInput(
|
||||
// Note that we use the attribute value rather than
|
||||
// WebFormControlElement::formControlType() for consistency with the
|
||||
// way the phishing classification model is created.
|
||||
std::string type = element.getAttribute("type").utf8();
|
||||
base::StringToLowerASCII(&type);
|
||||
std::string type = base::ToLowerASCII(element.getAttribute("type").utf8());
|
||||
if (type == "password") {
|
||||
++page_feature_state_->num_pswd_inputs;
|
||||
} else if (type == "radio") {
|
||||
|
@ -211,7 +211,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 = base::StringToLowerASCII(proxy_type);
|
||||
proxy_type = base::ToLowerASCII(proxy_type);
|
||||
if (proxy_type == "direct") {
|
||||
capabilities->switches.SetSwitch("no-proxy-server");
|
||||
} else if (proxy_type == "system") {
|
||||
|
@ -573,8 +573,7 @@ void ConvertHexadecimalToIDAlphabet(std::string* id) {
|
||||
std::string GenerateExtensionId(const std::string& input) {
|
||||
uint8 hash[16];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
std::string output =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
std::string output = base::ToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
ConvertHexadecimalToIDAlphabet(&output);
|
||||
return output;
|
||||
}
|
||||
|
@ -722,14 +722,14 @@ namespace internal {
|
||||
const char kNewSessionPathPattern[] = "session";
|
||||
|
||||
bool MatchesMethod(HttpMethod command_method, const std::string& method) {
|
||||
std::string lower_method = base::StringToLowerASCII(method);
|
||||
std::string lower_method = base::ToLowerASCII(method);
|
||||
switch (command_method) {
|
||||
case kGet:
|
||||
return lower_method == "get";
|
||||
case kPost:
|
||||
return lower_method == "post" || lower_method == "put";
|
||||
case kDelete:
|
||||
return lower_method == "delete";
|
||||
case kGet:
|
||||
return lower_method == "get";
|
||||
case kPost:
|
||||
return lower_method == "post" || lower_method == "put";
|
||||
case kDelete:
|
||||
return lower_method == "delete";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -95,8 +95,8 @@ SystemSaltGetter* SystemSaltGetter::Get() {
|
||||
// static
|
||||
std::string SystemSaltGetter::ConvertRawSaltToHexString(
|
||||
const std::vector<uint8>& salt) {
|
||||
return base::StringToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(salt.data()), salt.size()));
|
||||
return base::ToLowerASCII(
|
||||
base::HexEncode(reinterpret_cast<const void*>(salt.data()), salt.size()));
|
||||
}
|
||||
|
||||
} // namespace chromeos
|
||||
|
@ -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_ = base::StringToLowerASCII(base::HexEncode(
|
||||
secret_ = base::ToLowerASCII(base::HexEncode(
|
||||
reinterpret_cast<const void*>(hash), sizeof(hash) / 2));
|
||||
break;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ bool ValidateTicket(const std::string& ticket) {
|
||||
}
|
||||
|
||||
std::string GenerateId() {
|
||||
return base::StringToLowerASCII(base::GenerateGUID());
|
||||
return base::ToLowerASCII(base::GenerateGUID());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -62,7 +62,7 @@ std::string AudioTypeToString(AudioType audio_type) {
|
||||
}
|
||||
|
||||
bool ReadBooleanFlag(const std::string& flag, bool default_value) {
|
||||
const std::string flag_value = base::StringToLowerASCII(
|
||||
const std::string flag_value = base::ToLowerASCII(
|
||||
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(flag));
|
||||
if (flag_value == "true" || flag_value == "1")
|
||||
return true;
|
||||
|
@ -35,7 +35,7 @@ bool ActionAppliesToWalletItems(RequiredAction action) {
|
||||
|
||||
RequiredAction ParseRequiredActionFromString(const std::string& str) {
|
||||
std::string str_lower;
|
||||
base::TrimWhitespaceASCII(base::StringToLowerASCII(str), base::TRIM_ALL,
|
||||
base::TrimWhitespaceASCII(base::ToLowerASCII(str), base::TRIM_ALL,
|
||||
&str_lower);
|
||||
|
||||
if (str_lower == "setup_wallet")
|
||||
|
@ -1105,7 +1105,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 = base::StringToLowerASCII(autocomplete_attribute);
|
||||
autocomplete_attribute = base::ToLowerASCII(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
|
||||
|
@ -1061,23 +1061,22 @@ 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(base::StringToLowerASCII(base::UTF16ToASCII(
|
||||
country_codes.push_back(base::ToLowerASCII(base::UTF16ToASCII(
|
||||
profiles[i]->GetRawInfo(ADDRESS_HOME_COUNTRY))));
|
||||
}
|
||||
|
||||
std::string timezone_country = CountryCodeForCurrentTimezone();
|
||||
if (!timezone_country.empty())
|
||||
country_codes.push_back(base::StringToLowerASCII(timezone_country));
|
||||
country_codes.push_back(base::ToLowerASCII(timezone_country));
|
||||
|
||||
// Only take the locale into consideration if all else fails.
|
||||
if (country_codes.empty()) {
|
||||
country_codes.push_back(base::StringToLowerASCII(
|
||||
country_codes.push_back(base::ToLowerASCII(
|
||||
AutofillCountry::CountryCodeForLocale(app_locale())));
|
||||
}
|
||||
|
||||
return std::find(country_codes.begin(), country_codes.end(),
|
||||
base::StringToLowerASCII(country_code)) !=
|
||||
country_codes.end();
|
||||
base::ToLowerASCII(country_code)) != country_codes.end();
|
||||
}
|
||||
|
||||
const std::string& PersonalDataManager::GetDefaultCountryCodeForNewAddress()
|
||||
|
@ -43,7 +43,7 @@ bool IsUnwantedInElementID(char c) {
|
||||
std::string ScrubElementID8Bit(std::string element_id) {
|
||||
std::replace_if(
|
||||
element_id.begin(), element_id.end(), IsUnwantedInElementID, ' ');
|
||||
return base::StringToLowerASCII(element_id);
|
||||
return base::ToLowerASCII(element_id);
|
||||
}
|
||||
|
||||
SavePasswordProgressLogger::StringID FormSchemeToStringID(
|
||||
|
@ -211,7 +211,7 @@ ContentSettingsPattern ContentSettingsPattern::Builder::Build() {
|
||||
// static
|
||||
bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) {
|
||||
// Canonicalize the scheme part.
|
||||
const std::string scheme(base::StringToLowerASCII(parts->scheme));
|
||||
const std::string scheme(base::ToLowerASCII(parts->scheme));
|
||||
parts->scheme = scheme;
|
||||
|
||||
if (parts->scheme == std::string(url::kFileScheme) &&
|
||||
|
@ -61,7 +61,7 @@ CrxFile::ValidateError FinalizeHash(const std::string& extension_id,
|
||||
uint8 output[crypto::kSHA256Length] = {};
|
||||
hash->Finish(output, sizeof(output));
|
||||
std::string hash_base64 =
|
||||
base::StringToLowerASCII(base::HexEncode(output, sizeof(output)));
|
||||
base::ToLowerASCII(base::HexEncode(output, sizeof(output)));
|
||||
if (hash_base64 != expected_hash) {
|
||||
LOG(ERROR) << "Hash check failed for extension: " << extension_id
|
||||
<< ", expected " << expected_hash << ", got " << hash_base64;
|
||||
|
@ -40,7 +40,7 @@ std::string GenerateId(const std::string& input) {
|
||||
uint8 hash[kIdSize];
|
||||
crypto::SHA256HashString(input, hash, sizeof(hash));
|
||||
std::string output =
|
||||
base::StringToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
base::ToLowerASCII(base::HexEncode(hash, sizeof(hash)));
|
||||
ConvertHexadecimalToIDAlphabet(&output);
|
||||
|
||||
return output;
|
||||
@ -83,7 +83,7 @@ bool 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 = base::StringToLowerASCII(id);
|
||||
std::string temp = base::ToLowerASCII(id);
|
||||
for (size_t i = 0; i < temp.size(); i++)
|
||||
if (temp[i] < 'a' || temp[i] > 'p')
|
||||
return false;
|
||||
|
@ -220,7 +220,7 @@ void GetFormat(const std::string& format_string,
|
||||
}
|
||||
|
||||
LogType LogTypeFromString(const std::string& desc) {
|
||||
std::string desc_lc = base::StringToLowerASCII(desc);
|
||||
std::string desc_lc = base::ToLowerASCII(desc);
|
||||
if (desc_lc == "network")
|
||||
return LOG_TYPE_NETWORK;
|
||||
if (desc_lc == "power")
|
||||
|
@ -88,7 +88,6 @@ GURL ToggleHTTPAndHTTPS(const GURL& url) {
|
||||
|
||||
std::string HostForTopHosts(const GURL& url) {
|
||||
std::string host = url.host();
|
||||
base::StringToLowerASCII(&host);
|
||||
if (base::StartsWith(host, "www.", base::CompareCase::SENSITIVE))
|
||||
host.assign(host, 4, std::string::npos);
|
||||
return host;
|
||||
|
@ -42,8 +42,7 @@ int LanguageUsageMetrics::ToLanguageCode(const std::string& locale) {
|
||||
if (!parts.GetNext())
|
||||
return 0;
|
||||
|
||||
std::string language_part = parts.token();
|
||||
base::StringToLowerASCII(&language_part);
|
||||
std::string language_part = base::ToLowerASCII(parts.token());
|
||||
|
||||
int language_code = 0;
|
||||
for (std::string::iterator it = language_part.begin();
|
||||
|
@ -151,8 +151,7 @@ MimeUtil::MimeUtil() {
|
||||
}
|
||||
|
||||
bool MimeUtil::IsSupportedImageMimeType(const std::string& mime_type) const {
|
||||
return image_types_.find(base::StringToLowerASCII(mime_type)) !=
|
||||
image_types_.end();
|
||||
return image_types_.find(base::ToLowerASCII(mime_type)) != image_types_.end();
|
||||
}
|
||||
|
||||
bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const {
|
||||
|
@ -343,7 +343,7 @@ void NexeLoadManager::InitializePlugin(
|
||||
}
|
||||
|
||||
// Store mime_type_ at initialization time since we make it lowercase.
|
||||
mime_type_ = base::StringToLowerASCII(LookupAttribute(args_, kTypeAttribute));
|
||||
mime_type_ = base::ToLowerASCII(LookupAttribute(args_, kTypeAttribute));
|
||||
}
|
||||
|
||||
void NexeLoadManager::ReportStartupOverhead() const {
|
||||
|
@ -1559,7 +1559,7 @@ class PexeDownloader : public blink::WebURLLoaderClient {
|
||||
|
||||
for (const std::string& cur : base::SplitString(
|
||||
cache_control, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
||||
if (base::StringToLowerASCII(cur) == "no-store")
|
||||
if (base::ToLowerASCII(cur) == "no-store")
|
||||
has_no_store_header = true;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ bool GetUserPassFromData(const std::vector<unsigned char>& data,
|
||||
}
|
||||
|
||||
std::wstring GetUrlHash(const std::wstring& url) {
|
||||
std::wstring lower_case_url = base::StringToLowerASCII(url);
|
||||
std::wstring lower_case_url = base::ToLowerASCII(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()),
|
||||
@ -121,7 +121,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 = base::StringToLowerASCII(url);
|
||||
std::wstring lower_case_url = base::ToLowerASCII(url);
|
||||
DATA_BLOB input = {0};
|
||||
DATA_BLOB output = {0};
|
||||
DATA_BLOB url_key = {0};
|
||||
|
@ -49,15 +49,16 @@ bool IsValidYouTubeVideo(const std::string& path) {
|
||||
if (path.length() <= len)
|
||||
return false;
|
||||
|
||||
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)
|
||||
if (!base::StartsWith(path, kSlashVSlash,
|
||||
base::CompareCase::INSENSITIVE_ASCII) ||
|
||||
!base::StartsWith(path, kSlashESlash,
|
||||
base::CompareCase::INSENSITIVE_ASCII))
|
||||
return false;
|
||||
|
||||
// Start after /v/
|
||||
for (unsigned i = len; i < path.length(); i++) {
|
||||
char c = str[i];
|
||||
char c = path[i];
|
||||
if (isalpha(c) || isdigit(c) || c == '_' || c == '-')
|
||||
continue;
|
||||
// The url can have more parameters such as &hl=en after the video id.
|
||||
|
@ -186,7 +186,7 @@ void HandleRecord(const base::string16& key_name,
|
||||
return;
|
||||
}
|
||||
|
||||
std::string action_trigger(base::StringToLowerASCII(value_name.substr(
|
||||
std::string action_trigger(base::ToLowerASCII(value_name.substr(
|
||||
arraysize(kActionTriggerPrefix) - 1)));
|
||||
if (action_trigger == kActionTriggerDeleteValues) {
|
||||
for (const std::string& value :
|
||||
|
@ -96,7 +96,7 @@ 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 = base::StringToLowerASCII(document);
|
||||
const std::string document_folded = base::ToLowerASCII(document);
|
||||
|
||||
// Manually construct match_positions of the document.
|
||||
Snippet::MatchPositions match_positions;
|
||||
|
@ -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 base::StringToLowerASCII(base::HexEncode(&hash_val[0], kTruncateSize));
|
||||
return base::ToLowerASCII(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(base::StringToLowerASCII(dcim_dir)));
|
||||
mount_point.Append(base::ToLowerASCII(dcim_dir)));
|
||||
if (!base::DirectoryExists(dcim_path_lower))
|
||||
return false;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ std::string GenerateDeviceIdLikePrefMetricsServiceDid(
|
||||
const std::string& original_device_id) {
|
||||
if (original_device_id.empty())
|
||||
return std::string();
|
||||
return base::StringToLowerASCII(
|
||||
return base::ToLowerASCII(
|
||||
GetDigestString(original_device_id, "PrefMetricsService"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user