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

Side by Side Diff: webkit/fileapi/file_system_origin_database.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
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 "webkit/fileapi/file_system_origin_database.h" 5 #include "webkit/fileapi/file_system_origin_database.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 HandleError(FROM_HERE, status); 258 HandleError(FROM_HERE, status);
259 return false; 259 return false;
260 } 260 }
261 261
262 bool FileSystemOriginDatabase::ListAllOrigins( 262 bool FileSystemOriginDatabase::ListAllOrigins(
263 std::vector<OriginRecord>* origins) { 263 std::vector<OriginRecord>* origins) {
264 if (!Init(REPAIR_ON_CORRUPTION)) 264 if (!Init(REPAIR_ON_CORRUPTION))
265 return false; 265 return false;
266 DCHECK(origins); 266 DCHECK(origins);
267 scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions())); 267 scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions()));
268 std::string origin_key_prefix = OriginToOriginKey(""); 268 std::string origin_key_prefix = OriginToOriginKey(std::string());
269 iter->Seek(origin_key_prefix); 269 iter->Seek(origin_key_prefix);
270 origins->clear(); 270 origins->clear();
271 while (iter->Valid() && 271 while (iter->Valid() &&
272 StartsWithASCII(iter->key().ToString(), origin_key_prefix, true)) { 272 StartsWithASCII(iter->key().ToString(), origin_key_prefix, true)) {
273 std::string origin = 273 std::string origin =
274 iter->key().ToString().substr(origin_key_prefix.length()); 274 iter->key().ToString().substr(origin_key_prefix.length());
275 base::FilePath path = StringToFilePath(iter->value().ToString()); 275 base::FilePath path = StringToFilePath(iter->value().ToString());
276 origins->push_back(OriginRecord(origin, path)); 276 origins->push_back(OriginRecord(origin, path));
277 iter->Next(); 277 iter->Next();
278 } 278 }
(...skipping 30 matching lines...) Expand all
309 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); 309 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1"));
310 if (!status.ok()) { 310 if (!status.ok()) {
311 HandleError(FROM_HERE, status); 311 HandleError(FROM_HERE, status);
312 return false; 312 return false;
313 } 313 }
314 *number = -1; 314 *number = -1;
315 return true; 315 return true;
316 } 316 }
317 317
318 } // namespace fileapi 318 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_directory_database_unittest.cc ('k') | webkit/fileapi/file_system_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698