Index: storage/browser/fileapi/sandbox_origin_database.cc |
diff --git a/storage/browser/fileapi/sandbox_origin_database.cc b/storage/browser/fileapi/sandbox_origin_database.cc |
index 85424a2351c8b3f08a5db910cc71491bc3f32d43..12bbafead7d9c06c60e59ef3a72949d1ba1dc3ff 100644 |
--- a/storage/browser/fileapi/sandbox_origin_database.cc |
+++ b/storage/browser/fileapi/sandbox_origin_database.cc |
@@ -331,16 +331,18 @@ bool SandboxOriginDatabase::GetLastPathNumber(int* number) { |
return false; |
} |
// Verify that this is a totally new database, and initialize it. |
- scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions())); |
- iter->SeekToFirst(); |
- if (iter->Valid()) { // DB was not empty, but had no last path number! |
- LOG(ERROR) << "File system origin database is corrupt!"; |
- return false; |
+ { |
+ scoped_ptr<leveldb::Iterator> iter( |
nhiroki
2016/01/27 00:48:00
ditto.
cmumford
2016/01/27 16:33:56
Done.
|
+ db_->NewIterator(leveldb::ReadOptions())); |
+ iter->SeekToFirst(); |
+ if (iter->Valid()) { // DB was not empty, but had no last path number! |
+ LOG(ERROR) << "File system origin database is corrupt!"; |
+ return false; |
+ } |
} |
// This is always the first write into the database. If we ever add a |
// version number, they should go in in a single transaction. |
- status = |
- db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); |
+ status = db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); |
if (!status.ok()) { |
HandleError(FROM_HERE, status); |
return false; |