summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-16 16:57:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 23:58:34 +0000
commit955093110ad64d5ec6f5426991efaa4a680b5d6f (patch)
tree19368cdb8861595640715e1072789959729efc2d /storage
parent387e05a79c7ae346ba7db36977ddfca7ca6f10a3 (diff)
downloadchromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.zip
chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.gz
chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.bz2
Remove legacy StartsWithASCII function.
This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change. BUG=506255 TBR=jam Review URL: https://codereview.chromium.org/1242023005 Cr-Commit-Position: refs/heads/master@{#339175}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/blob/blob_url_request_job_factory.cc3
-rw-r--r--storage/browser/fileapi/obfuscated_file_util.cc6
-rw-r--r--storage/browser/fileapi/sandbox_directory_database.cc8
-rw-r--r--storage/browser/fileapi/sandbox_origin_database.cc5
4 files changed, 14 insertions, 8 deletions
diff --git a/storage/browser/blob/blob_url_request_job_factory.cc b/storage/browser/blob/blob_url_request_job_factory.cc
index 7efe280..feb5df0 100644
--- a/storage/browser/blob/blob_url_request_job_factory.cc
+++ b/storage/browser/blob/blob_url_request_job_factory.cc
@@ -78,7 +78,8 @@ scoped_ptr<BlobDataSnapshot> BlobProtocolHandler::LookupBlobData(
// TODO(michaeln): Replace this use case and others like it with a BlobReader
// impl that does not depend on urlfetching to perform this function.
const std::string kPrefix("blob:uuid/");
- if (!base::StartsWithASCII(request->url().spec(), kPrefix, true))
+ if (!base::StartsWith(request->url().spec(), kPrefix,
+ base::CompareCase::SENSITIVE))
return NULL;
std::string uuid = request->url().spec().substr(kPrefix.length());
scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
diff --git a/storage/browser/fileapi/obfuscated_file_util.cc b/storage/browser/fileapi/obfuscated_file_util.cc
index 34c0718..d46078e 100644
--- a/storage/browser/fileapi/obfuscated_file_util.cc
+++ b/storage/browser/fileapi/obfuscated_file_util.cc
@@ -901,7 +901,8 @@ void ObfuscatedFileUtil::CloseFileSystemForOriginAndType(
const std::string key_prefix = GetDirectoryDatabaseKey(origin, type_string);
for (DirectoryMap::iterator iter = directories_.lower_bound(key_prefix);
iter != directories_.end();) {
- if (!base::StartsWithASCII(iter->first, key_prefix, true))
+ if (!base::StartsWith(iter->first, key_prefix,
+ base::CompareCase::SENSITIVE))
break;
DCHECK(type_string.empty() || iter->first == key_prefix);
scoped_ptr<SandboxDirectoryDatabase> database(iter->second);
@@ -925,7 +926,8 @@ void ObfuscatedFileUtil::DestroyDirectoryDatabase(
const std::string key_prefix = GetDirectoryDatabaseKey(origin, type_string);
for (DirectoryMap::iterator iter = directories_.lower_bound(key_prefix);
iter != directories_.end();) {
- if (!base::StartsWithASCII(iter->first, key_prefix, true))
+ if (!base::StartsWith(iter->first, key_prefix,
+ base::CompareCase::SENSITIVE))
break;
DCHECK(type_string.empty() || iter->first == key_prefix);
scoped_ptr<SandboxDirectoryDatabase> database(iter->second);
diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc
index 7f7a707..39f1d53 100644
--- a/storage/browser/fileapi/sandbox_directory_database.cc
+++ b/storage/browser/fileapi/sandbox_directory_database.cc
@@ -204,7 +204,8 @@ bool DatabaseCheckHelper::ScanDatabase() {
scoped_ptr<leveldb::Iterator> itr(db_->NewIterator(leveldb::ReadOptions()));
for (itr->SeekToFirst(); itr->Valid(); itr->Next()) {
std::string key = itr->key().ToString();
- if (base::StartsWithASCII(key, kChildLookupPrefix, true)) {
+ if (base::StartsWith(key, kChildLookupPrefix,
+ base::CompareCase::SENSITIVE)) {
// key: "CHILD_OF:<parent_id>:<name>"
// value: "<child_id>"
++num_hierarchy_links_in_db_;
@@ -479,8 +480,9 @@ bool SandboxDirectoryDatabase::ListChildren(
scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions()));
iter->Seek(child_key_prefix);
children->clear();
- while (iter->Valid() && base::StartsWithASCII(iter->key().ToString(),
- child_key_prefix, true)) {
+ while (iter->Valid() && base::StartsWith(iter->key().ToString(),
+ child_key_prefix,
+ base::CompareCase::SENSITIVE)) {
std::string child_id_string = iter->value().ToString();
FileId child_id;
if (!base::StringToInt64(child_id_string, &child_id)) {
diff --git a/storage/browser/fileapi/sandbox_origin_database.cc b/storage/browser/fileapi/sandbox_origin_database.cc
index 1a91b10..024e13e 100644
--- a/storage/browser/fileapi/sandbox_origin_database.cc
+++ b/storage/browser/fileapi/sandbox_origin_database.cc
@@ -291,8 +291,9 @@ bool SandboxOriginDatabase::ListAllOrigins(
std::string origin_key_prefix = OriginToOriginKey(std::string());
iter->Seek(origin_key_prefix);
origins->clear();
- while (iter->Valid() && base::StartsWithASCII(iter->key().ToString(),
- origin_key_prefix, true)) {
+ while (iter->Valid() && base::StartsWith(iter->key().ToString(),
+ origin_key_prefix,
+ base::CompareCase::SENSITIVE)) {
std::string origin =
iter->key().ToString().substr(origin_key_prefix.length());
base::FilePath path = StringToFilePath(iter->value().ToString());