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

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

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Observer moved to connection 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_connection.h
diff --git a/content/browser/indexed_db/indexed_db_connection.h b/content/browser/indexed_db/indexed_db_connection.h
index 4d828e5e6ff5e28a138f19c79959f5a928ab165e..80a3e09f274ccadda542ded01650cccb2a273643 100644
--- a/content/browser/indexed_db/indexed_db_connection.h
+++ b/content/browser/indexed_db/indexed_db_connection.h
@@ -14,6 +14,7 @@
namespace content {
class IndexedDBCallbacks;
class IndexedDBDatabaseError;
+class IndexedDBObserver;
class CONTENT_EXPORT IndexedDBConnection {
public:
@@ -27,10 +28,13 @@ class CONTENT_EXPORT IndexedDBConnection {
virtual bool IsConnected();
void VersionChangeIgnored();
+ void Unobserve(std::vector<int32_t> observersToRemove);
dmurph 2016/06/22 01:09:49 const ref, and please use underscore_naming
palakj1 2016/06/23 20:56:29 changed to const ref.
IndexedDBDatabase* database() const { return database_.get(); }
IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); }
+ std::vector<std::unique_ptr<IndexedDBObserver>> active_observers_;
+
private:
// NULL in some unit tests, and after the connection is closed.
scoped_refptr<IndexedDBDatabase> database_;
@@ -38,7 +42,6 @@ class CONTENT_EXPORT IndexedDBConnection {
// The callbacks_ member is cleared when the connection is closed.
// May be NULL in unit tests.
scoped_refptr<IndexedDBDatabaseCallbacks> callbacks_;
-
base::WeakPtrFactory<IndexedDBConnection> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(IndexedDBConnection);

Powered by Google App Engine
This is Rietveld 408576698