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

Unified Diff: content/browser/indexed_db/indexed_db_database.h

Issue 2084053004: IndexedDB: Defer delete calls when there is a running upgrade (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, made delete lists contain unique_ptrs Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_database.h
diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h
index 527b516708fe885e6c6065ec39ca61e9b22597c6..70d9b54d4a73da4079cdc2c6eeecd8e32633ebc9 100644
--- a/content/browser/indexed_db/indexed_db_database.h
+++ b/content/browser/indexed_db/indexed_db_database.h
@@ -267,6 +267,9 @@ class CONTENT_EXPORT IndexedDBDatabase
typedef std::map<int64_t, IndexedDBTransaction*> TransactionMap;
typedef list_set<IndexedDBConnection*> ConnectionSet;
+ bool IsUpgradeRunning() const;
+ bool IsUpgradePendingOrRunning() const;
+
bool IsOpenConnectionBlocked() const;
leveldb::Status OpenInternal();
void RunVersionChangeTransaction(
@@ -307,11 +310,38 @@ class CONTENT_EXPORT IndexedDBDatabase
IndexedDBTransactionCoordinator transaction_coordinator_;
TransactionMap transactions_;
+
+ // An open request ends up here if:
+ // * There is a running or pending upgrade.
+ // * There are pending deletes.
+ // Requests here have *not* broadcast OnVersionChange if necessary.
+ // When no longer blocked, the OpenConnection() calls are remade.
std::queue<IndexedDBPendingConnection> pending_open_calls_;
+
+ // This owns the connection for the first upgrade request (open with higher
+ // version) that could not be immediately processed. The request has already
+ // broadcast OnVersionChange if necessary.
std::unique_ptr<PendingUpgradeCall>
pending_run_version_change_transaction_call_;
+
+ // This references a connection for an upgrade request while the upgrade
+ // transaction is running, so that the success/error result can be sent. It
+ // is not set until the upgrade transaction actually starts executing
+ // operations, so do not rely on it to determine if an upgrade is in
+ // progress.
std::unique_ptr<PendingSuccessCall> pending_second_half_open_;
- std::list<PendingDeleteCall*> pending_delete_calls_;
+
+ // A delete request ends up here if:
+ // * There is a running upgrade.
+ // Requests here have *not* broadcast OnVersionChange if necessary.
+ // When no longer blocked, DeleteDatabase() calls are remade.
+ std::list<std::unique_ptr<PendingDeleteCall>> pending_delete_calls_;
+
+ // A delete request ends up here if:
+ // * There are open connections.
+ // Requests here have already broadcast OnVersionChange if necessary.
+ // When no longer blocked, DeleteDatabaseFinal() calls are made.
+ std::list<std::unique_ptr<PendingDeleteCall>> blocked_delete_calls_;
ConnectionSet connections_;
bool experimental_web_platform_features_enabled_;
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698