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

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

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.h
diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h
index 72d65ce723e985a331cdd2c3e286af32d2ade7c3..f659161cad5ff74c849697632c611a2e45eb9302 100644
--- a/content/browser/indexed_db/indexed_db_database.h
+++ b/content/browser/indexed_db/indexed_db_database.h
@@ -38,6 +38,7 @@ class IndexedDBFactory;
class IndexedDBKey;
class IndexedDBKeyPath;
class IndexedDBKeyRange;
+class IndexedDBObserver;
class IndexedDBTransaction;
struct IndexedDBValue;
@@ -50,6 +51,8 @@ class CONTENT_EXPORT IndexedDBDatabase
// Identifier is pair of (origin, database name).
using Identifier = std::pair<url::Origin, base::string16>;
+ std::vector<std::unique_ptr<IndexedDBObserver>> active_observers_;
dmurph 2016/06/15 12:49:43 we'll want a map here of unique id -> observer so
palakj1 2016/06/16 07:05:40 Done.
+
static const int64_t kInvalidId = 0;
static const int64_t kMinimumIndexId = 30;
@@ -124,6 +127,8 @@ class CONTENT_EXPORT IndexedDBDatabase
// Called by transactions to report failure committing to the backing store.
void TransactionCommitFailed(const leveldb::Status& status);
+ void Observe(int64_t transaction_id, int64_t observer_id);
+
void Get(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,

Powered by Google App Engine
This is Rietveld 408576698