Chromium Code Reviews| 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..dae6fb25c450a0cf1c4dcf293dce49d15fde1523 100644 |
| --- a/content/browser/indexed_db/indexed_db_connection.h |
| +++ b/content/browser/indexed_db/indexed_db_connection.h |
| @@ -10,6 +10,7 @@ |
| #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; |
| @@ -27,9 +28,19 @@ class CONTENT_EXPORT IndexedDBConnection { |
| virtual bool IsConnected(); |
| void VersionChangeIgnored(); |
| + void ActivatePendingObservers( |
|
Marijn Kruisselbrink
2016/06/28 18:58:31
I think some comments here could be helpful too. F
palakj1
2016/06/29 23:02:40
Thanks. This was really important. Added some comm
|
| + std::vector<std::unique_ptr<IndexedDBObserver>> pending_observers); |
| + void RemoveObservers(const std::vector<int32_t>& remove_observer_ids); |
| IndexedDBDatabase* database() const { return database_.get(); } |
| IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); } |
| + const std::vector<std::unique_ptr<IndexedDBObserver>>& GetActiveObservers() |
|
cmumford
2016/06/28 20:26:22
This is a "getter" so you can name it active_obser
palakj1
2016/06/29 23:02:40
Is the current GetActiveObservers usage wrong? Cha
|
| + const { |
| + return active_observers_; |
| + } |
| + base::WeakPtr<IndexedDBConnection> GetWeakPtr() { |
|
cmumford
2016/06/28 20:26:22
I think this is the "old" way. Instead consider de
Marijn Kruisselbrink
2016/06/28 20:37:30
The "old" way? I think in general a WeakPtrFactory
palakj1
2016/06/30 18:11:44
Not really sure about thread safety. The transacti
cmumford
2016/07/01 18:35:00
Wow! Thanks for pointing that out Marijn.
|
| + return weak_factory_.GetWeakPtr(); |
| + } |
| private: |
| // NULL in some unit tests, and after the connection is closed. |
| @@ -38,7 +49,7 @@ class CONTENT_EXPORT IndexedDBConnection { |
| // 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); |