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

Unified Diff: content/browser/indexed_db/indexed_db_connection.cc

Issue 2601983002: [IndexedDB] Adding transaction and value support to observers (Closed)
Patch Set: added comments and bug link Created 3 years, 11 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
Index: content/browser/indexed_db/indexed_db_connection.cc
diff --git a/content/browser/indexed_db/indexed_db_connection.cc b/content/browser/indexed_db/indexed_db_connection.cc
index 216786a1d365f783f207895b0158fbce7808eab7..6e72e36bd19f28a1462eb872bae2e0eb94243354 100644
--- a/content/browser/indexed_db/indexed_db_connection.cc
+++ b/content/browser/indexed_db/indexed_db_connection.cc
@@ -158,4 +158,12 @@ void IndexedDBConnection::RemoveTransaction(int64_t id) {
transactions_.erase(id);
}
+int64_t IndexedDBConnection::NewObserverTransactionId() {
+ // When we overflow to 0, reset the ID to 1 (id of 0 is reserved for upgrade
+ // transactions).
+ if (next_observer_transaction_id_ == 0)
+ next_observer_transaction_id_ = 1;
+ return static_cast<int64_t>(next_observer_transaction_id_++) << 32;
+}
+
} // namespace content
« no previous file with comments | « content/browser/indexed_db/indexed_db_connection.h ('k') | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698