Chromium Code Reviews| Index: webkit/dom_storage/dom_storage_database.cc |
| diff --git a/webkit/dom_storage/dom_storage_database.cc b/webkit/dom_storage/dom_storage_database.cc |
| index 673ddde5380433e9b6d246b2799765cbef82a548..53adbc670a1cb74c1b085bb5f6bd98218cd274fc 100644 |
| --- a/webkit/dom_storage/dom_storage_database.cc |
| +++ b/webkit/dom_storage/dom_storage_database.cc |
| @@ -40,6 +40,16 @@ DomStorageDatabase::DomStorageDatabase(const FilePath& file_path) |
| } |
| DomStorageDatabase::~DomStorageDatabase() { |
| + if (IsOpen()) { |
| + sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, |
| + "SELECT COUNT(key) from ItemTable")); |
|
michaeln
2012/02/23 20:48:48
like we chatted about, can the 'its empty' conditi
benm (inactive)
2012/02/24 12:42:01
Done, but moved to it's own CL in http://coderevie
|
| + if (statement.Step() && statement.ColumnInt(0) == 0) { |
| + // Delete the db from disk, it's empty. |
| + statement.Clear(); |
| + Close(); |
| + file_util::Delete(file_path_, false); |
| + } |
| + } |
| } |
| void DomStorageDatabase::ReadAllValues(ValuesMap* result) { |