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

Side by Side Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 93873017: IndexedDBFactory now ForceCloses databases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_database.h" 5 #include "content/browser/indexed_db/indexed_db_database.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 } 1639 }
1640 metadata_.version = kNoStringVersion; 1640 metadata_.version = kNoStringVersion;
1641 metadata_.id = kInvalidId; 1641 metadata_.id = kInvalidId;
1642 metadata_.int_version = IndexedDBDatabaseMetadata::NO_INT_VERSION; 1642 metadata_.int_version = IndexedDBDatabaseMetadata::NO_INT_VERSION;
1643 metadata_.object_stores.clear(); 1643 metadata_.object_stores.clear();
1644 callbacks->OnSuccess(); 1644 callbacks->OnSuccess();
1645 if (factory_) 1645 if (factory_)
1646 factory_->DatabaseDeleted(identifier_); 1646 factory_->DatabaseDeleted(identifier_);
1647 } 1647 }
1648 1648
1649 void IndexedDBDatabase::ForceClose()
1650 {
1651 ConnectionSet conns(connections_);
1652 for (ConnectionSet::iterator i = conns.begin(); i != conns.end(); ++i) {
jsbell 2013/12/19 22:35:34 Nit: no need for braces for single-line loop body.
1653 (*i)->ForceClose();
1654 }
1655 }
1656
1649 void IndexedDBDatabase::Close(IndexedDBConnection* connection, bool forced) { 1657 void IndexedDBDatabase::Close(IndexedDBConnection* connection, bool forced) {
1650 DCHECK(connections_.count(connection)); 1658 DCHECK(connections_.count(connection));
1651 DCHECK(connection->IsConnected()); 1659 DCHECK(connection->IsConnected());
1652 DCHECK(connection->database() == this); 1660 DCHECK(connection->database() == this);
1653 1661
1654 // Abort outstanding transactions from the closing connection. This 1662 // Abort outstanding transactions from the closing connection. This
1655 // can not happen if the close is requested by the connection itself 1663 // can not happen if the close is requested by the connection itself
1656 // as the front-end defers the close until all transactions are 1664 // as the front-end defers the close until all transactions are
1657 // complete, but can occur on process termination or forced close. 1665 // complete, but can occur on process termination or forced close.
1658 { 1666 {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 const base::string16& previous_version, 1725 const base::string16& previous_version,
1718 int64 previous_int_version, 1726 int64 previous_int_version,
1719 IndexedDBTransaction* transaction) { 1727 IndexedDBTransaction* transaction) {
1720 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); 1728 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation");
1721 DCHECK(!transaction); 1729 DCHECK(!transaction);
1722 metadata_.version = previous_version; 1730 metadata_.version = previous_version;
1723 metadata_.int_version = previous_int_version; 1731 metadata_.int_version = previous_int_version;
1724 } 1732 }
1725 1733
1726 } // namespace content 1734 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698