Index: content/browser/indexed_db/indexed_db_connection.h |
diff --git a/content/browser/indexed_db/indexed_db_connection.h b/content/browser/indexed_db/indexed_db_connection.h |
index 4d828e5e6ff5e28a138f19c79959f5a928ab165e..9c097a99f7f240323b178c09a28eaa498088cdb5 100644 |
--- a/content/browser/indexed_db/indexed_db_connection.h |
+++ b/content/browser/indexed_db/indexed_db_connection.h |
@@ -10,9 +10,9 @@ |
#include "base/memory/weak_ptr.h" |
#include "content/browser/indexed_db/indexed_db_database.h" |
#include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
+#include "content/browser/indexed_db/indexed_db_observer.h" |
namespace content { |
-class IndexedDBCallbacks; |
class IndexedDBDatabaseError; |
class CONTENT_EXPORT IndexedDBConnection { |
@@ -28,17 +28,38 @@ class CONTENT_EXPORT IndexedDBConnection { |
void VersionChangeIgnored(); |
+ virtual void ActivatePendingObservers( |
+ std::vector<std::unique_ptr<IndexedDBObserver>> pending_observers); |
+ // Removes observer listed in |remove_observer_ids| from active_observer of |
+ // connection or pending_observer of transactions associated with this |
+ // connection. |
+ virtual void RemoveObservers(const std::vector<int32_t>& remove_observer_ids); |
+ |
+ void set_id(int32_t id); |
+ int32_t id() const { return id_; } |
+ |
IndexedDBDatabase* database() const { return database_.get(); } |
IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); } |
+ const std::vector<std::unique_ptr<IndexedDBObserver>>& active_observers() |
+ const { |
+ return active_observers_; |
+ } |
+ base::WeakPtr<IndexedDBConnection> GetWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+ } |
private: |
+ enum { kInvalidId = -1 }; |
+ // id_ is ipc_database_id |
+ int32_t id_ = kInvalidId; |
+ |
// NULL in some unit tests, and after the connection is closed. |
scoped_refptr<IndexedDBDatabase> database_; |
// The callbacks_ member is cleared when the connection is closed. |
// May be NULL in unit tests. |
scoped_refptr<IndexedDBDatabaseCallbacks> callbacks_; |
- |
+ std::vector<std::unique_ptr<IndexedDBObserver>> active_observers_; |
base::WeakPtrFactory<IndexedDBConnection> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(IndexedDBConnection); |