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

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

Issue 2160163002: [IndexedDB] Propogating Changes to Observer : Browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working Observer 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
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 e889d4389ebb2780278c1a0d38b313dccf8b4ecf..130f08df1f7d59ab556b785f9c1625c705a760d7 100644
--- a/content/browser/indexed_db/indexed_db_transaction.h
+++ b/content/browser/indexed_db/indexed_db_transaction.h
@@ -21,6 +21,7 @@
#include "content/browser/indexed_db/indexed_db_connection.h"
#include "content/browser/indexed_db/indexed_db_database.h"
#include "content/browser/indexed_db/indexed_db_database_error.h"
+#include "content/browser/indexed_db/indexed_db_observer.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
namespace content {
@@ -28,7 +29,8 @@ namespace content {
class BlobWriteCallbackImpl;
class IndexedDBCursor;
class IndexedDBDatabaseCallbacks;
-class IndexedDBObserver;
+class IndexedDBObservation;
+class IndexedDBObserverChanges;
class CONTENT_EXPORT IndexedDBTransaction
: public NON_EXPORTED_BASE(base::RefCounted<IndexedDBTransaction>) {
@@ -65,10 +67,18 @@ class CONTENT_EXPORT IndexedDBTransaction
pending_preemptive_events_--;
DCHECK_GE(pending_preemptive_events_, 0);
}
- void AddPendingObserver(int32_t observer_id);
+ void AddPendingObserver(int32_t observer_id, IndexedDBObserver::Options);
// Delete pending observers with ID's listed in |pending_observer_ids|.
void RemovePendingObservers(const std::vector<int32_t>& pending_observer_ids);
+ // Adds observation for the connection.
+ void AddObservation(int32_t connection_id,
+ std::unique_ptr<IndexedDBObservation>);
+ // Adds the last observation index to observer_id's list of recorded
+ // observation indices.
+ void RecordObserverForLastObservation(int32_t connection_id,
+ int32_t observer_id);
+
IndexedDBBackingStore::Transaction* BackingStoreTransaction() {
return transaction_.get();
}
@@ -143,6 +153,8 @@ class CONTENT_EXPORT IndexedDBTransaction
// Observers in pending queue do not listen to changes until activated.
std::vector<std::unique_ptr<IndexedDBObserver>> pending_observers_;
+ std::map<int32_t, std::unique_ptr<IndexedDBObserverChanges>>
+ connection_changes_map_;
class TaskQueue {
public:

Powered by Google App Engine
This is Rietveld 408576698