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

Unified Diff: content/browser/indexed_db/indexed_db_transaction.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_transaction.h
diff --git a/content/browser/indexed_db/indexed_db_transaction.h b/content/browser/indexed_db/indexed_db_transaction.h
index ae1863b151f161ab6fc82e3ca1b575171d784568..07db2c32a03e8ab1e29c8103567ae37c4c2b03e7 100644
--- a/content/browser/indexed_db/indexed_db_transaction.h
+++ b/content/browser/indexed_db/indexed_db_transaction.h
@@ -27,6 +27,7 @@ namespace content {
class BlobWriteCallbackImpl;
class IndexedDBCursor;
class IndexedDBDatabaseCallbacks;
+class IndexedDBObserver;
class CONTENT_EXPORT IndexedDBTransaction
: public NON_EXPORTED_BASE(base::RefCounted<IndexedDBTransaction>) {
@@ -63,6 +64,8 @@ class CONTENT_EXPORT IndexedDBTransaction
pending_preemptive_events_--;
DCHECK_GE(pending_preemptive_events_, 0);
}
+ void AddPendingObserver(std::unique_ptr<IndexedDBObserver> observer);
+
IndexedDBBackingStore::Transaction* BackingStoreTransaction() {
return transaction_.get();
}
@@ -123,6 +126,8 @@ class CONTENT_EXPORT IndexedDBTransaction
leveldb::Status CommitPhaseTwo();
void Timeout();
+ void AddActiveObserver();
dmurph 2016/06/15 12:49:43 what about 'MaybeActivatePendingObservers()'
palakj1 2016/06/16 07:05:40 yaa, that's a lot more intutive. changed.
+
const int64_t id_;
const std::set<int64_t> object_store_ids_;
const blink::WebIDBTransactionMode mode_;
@@ -174,6 +179,7 @@ class CONTENT_EXPORT IndexedDBTransaction
int pending_preemptive_events_;
std::set<IndexedDBCursor*> open_cursors_;
+ std::vector<std::unique_ptr<IndexedDBObserver>> pending_observers_;
// This timer is started after requests have been processed. If no subsequent
// requests are processed before the timer fires, assume the script is

Powered by Google App Engine
This is Rietveld 408576698