Chromium Code Reviews| Index: content/browser/indexed_db/indexed_db_factory_impl.cc |
| diff --git a/content/browser/indexed_db/indexed_db_factory_impl.cc b/content/browser/indexed_db/indexed_db_factory_impl.cc |
| index f25989dcfa1326f4a3ccdd6a467d431ed6aa1bfe..a05a0601c3eb379f550dbcef110e702669b0eb1f 100644 |
| --- a/content/browser/indexed_db/indexed_db_factory_impl.cc |
| +++ b/content/browser/indexed_db/indexed_db_factory_impl.cc |
| @@ -213,15 +213,20 @@ void IndexedDBFactoryImpl::DeleteDatabase( |
| scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| scoped_refptr<IndexedDBCallbacks> callbacks, |
| const Origin& origin, |
| - const base::FilePath& data_directory) { |
| + const base::FilePath& data_directory, |
| + bool force_close) { |
| IDB_TRACE("IndexedDBFactoryImpl::DeleteDatabase"); |
| IndexedDBDatabase::Identifier unique_identifier(origin, name); |
| const auto& it = database_map_.find(unique_identifier); |
| if (it != database_map_.end()) { |
| - // If there are any connections to the database, directly delete the |
| - // database. |
| - it->second->DeleteDatabase(callbacks); |
| - return; |
| + if (force_close) { |
| + it->second->ForceClose(); |
|
cmumford
2017/01/19 20:47:16
Any reason why we can't pass force_close into Dele
eostroukhov
2017/01/20 18:43:18
Did that, also added a test.
|
| + } else { |
| + // If there are any connections to the database, directly delete the |
| + // database. |
| + it->second->DeleteDatabase(callbacks); |
| + return; |
| + } |
| } |
| // TODO(dgrogan): Plumb data_loss back to script eventually? |