Chromium Code Reviews| Index: storage/browser/fileapi/sandbox_directory_database.cc |
| diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc |
| index 343f09f5c7a22eb194434c9ed5d765ee8b69f6df..add0c3276b22da347cdc18c856af220f75c5057d 100644 |
| --- a/storage/browser/fileapi/sandbox_directory_database.cc |
| +++ b/storage/browser/fileapi/sandbox_directory_database.cc |
| @@ -844,11 +844,14 @@ void SandboxDirectoryDatabase::ReportInitStatus( |
| bool SandboxDirectoryDatabase::StoreDefaultValues() { |
| // 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--we shouldn't have been called. |
| - LOG(ERROR) << "File system origin database is corrupt!"; |
| - return false; |
| + { |
| + scoped_ptr<leveldb::Iterator> iter( |
|
nhiroki
2016/01/27 00:48:00
Can you add a comment about why we need to wrap th
cmumford
2016/01/27 16:33:56
Done.
|
| + db_->NewIterator(leveldb::ReadOptions())); |
| + iter->SeekToFirst(); |
| + if (iter->Valid()) { // DB was not empty--we shouldn't have been called. |
| + 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, it should go in this transaction too. |