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

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

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding Observer Created 4 years, 6 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_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 97f47a04d14cd726d5f86b16f2b6c7a9502a7995..f2212d3083d49677da5b802dcb2993bd3fc60cb9 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -29,6 +29,7 @@
#include "content/browser/indexed_db/indexed_db_cursor.h"
#include "content/browser/indexed_db/indexed_db_factory.h"
#include "content/browser/indexed_db/indexed_db_index_writer.h"
+#include "content/browser/indexed_db/indexed_db_observer.h"
#include "content/browser/indexed_db/indexed_db_pending_connection.h"
#include "content/browser/indexed_db/indexed_db_return_value.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
@@ -541,6 +542,14 @@ void IndexedDBDatabase::Abort(int64_t transaction_id,
transaction->Abort(error);
}
+void IndexedDBDatabase::Observe(int64_t transaction_id, int64_t observer_id) {
+ IndexedDBTransaction* transaction = GetTransaction(transaction_id);
+ if (!transaction)
+ return;
+ transaction->AddPendingObserver(
+ base::WrapUnique(new IndexedDBObserver(observer_id)));
+}
+
void IndexedDBDatabase::GetAll(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,

Powered by Google App Engine
This is Rietveld 408576698