Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: storage/browser/fileapi/sandbox_origin_database.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "storage/browser/fileapi/sandbox_origin_database.h" 5 #include "storage/browser/fileapi/sandbox_origin_database.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 std::vector<OriginRecord>* origins) { 284 std::vector<OriginRecord>* origins) {
285 DCHECK(origins); 285 DCHECK(origins);
286 if (!Init(CREATE_IF_NONEXISTENT, REPAIR_ON_CORRUPTION)) { 286 if (!Init(CREATE_IF_NONEXISTENT, REPAIR_ON_CORRUPTION)) {
287 origins->clear(); 287 origins->clear();
288 return false; 288 return false;
289 } 289 }
290 scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions())); 290 scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions()));
291 std::string origin_key_prefix = OriginToOriginKey(std::string()); 291 std::string origin_key_prefix = OriginToOriginKey(std::string());
292 iter->Seek(origin_key_prefix); 292 iter->Seek(origin_key_prefix);
293 origins->clear(); 293 origins->clear();
294 while (iter->Valid() && base::StartsWithASCII(iter->key().ToString(), 294 while (iter->Valid() && base::StartsWith(iter->key().ToString(),
295 origin_key_prefix, true)) { 295 origin_key_prefix,
296 base::CompareCase::SENSITIVE)) {
296 std::string origin = 297 std::string origin =
297 iter->key().ToString().substr(origin_key_prefix.length()); 298 iter->key().ToString().substr(origin_key_prefix.length());
298 base::FilePath path = StringToFilePath(iter->value().ToString()); 299 base::FilePath path = StringToFilePath(iter->value().ToString());
299 origins->push_back(OriginRecord(origin, path)); 300 origins->push_back(OriginRecord(origin, path));
300 iter->Next(); 301 iter->Next();
301 } 302 }
302 return true; 303 return true;
303 } 304 }
304 305
305 void SandboxOriginDatabase::DropDatabase() { 306 void SandboxOriginDatabase::DropDatabase() {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); 341 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1"));
341 if (!status.ok()) { 342 if (!status.ok()) {
342 HandleError(FROM_HERE, status); 343 HandleError(FROM_HERE, status);
343 return false; 344 return false;
344 } 345 }
345 *number = -1; 346 *number = -1;
346 return true; 347 return true;
347 } 348 }
348 349
349 } // namespace storage 350 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/sandbox_directory_database.cc ('k') | third_party/zlib/google/zip_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698