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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher.h

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post dmuprh review 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/child/indexed_db/indexed_db_dispatcher.h
diff --git a/content/child/indexed_db/indexed_db_dispatcher.h b/content/child/indexed_db/indexed_db_dispatcher.h
index 9e5068db7b6f12e14a3ef48bc722d0bcdf3e2093..edb0d9d39cbd42214aa4920436d2000aa248edb8 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.h
+++ b/content/child/indexed_db/indexed_db_dispatcher.h
@@ -24,6 +24,7 @@
#include "third_party/WebKit/public/platform/WebBlobInfo.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCallbacks.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseCallbacks.h"
+#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBObserver.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
#include "url/origin.h"
@@ -74,6 +75,15 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
// This method is virtual so it can be overridden in unit tests.
virtual bool Send(IPC::Message* msg);
+ int32_t AddIDBObserver(int32_t ipc_database_id,
dmurph 2016/06/23 21:53:04 How about AddObserver, IDB is redundant.
palakj1 2016/06/24 00:03:01 There's another Observer associated with WorkerThr
+ int64_t transaction_id,
+ std::unique_ptr<blink::WebIDBObserver> observer);
+ std::vector<int32_t> RemoveIDBObservers(
dmurph 2016/06/23 21:53:04 How about 'RemoveObserversForDatabase'
palakj1 2016/06/24 00:03:00 Done. RemoveIDBObserversFromDatabse (IDB due to th
+ int32_t ipc_database_id,
+ std::unique_ptr<blink::WebIDBObserver> observer,
+ const std::vector<int32_t>& database_observers_id);
dmurph 2016/06/23 21:53:04 database_observer_ids
palakj1 2016/06/24 00:03:00 Done.
+ void ClearIDBObserver(const std::vector<int32_t>& observer_ids_to_remove);
dmurph 2016/06/23 21:53:04 Then just 'RemoveObservers' here, and comment that
palakj1 2016/06/24 00:03:01 Done.
+
void RequestIDBFactoryGetDatabaseNames(blink::WebIDBCallbacks* callbacks,
const url::Origin& origin);
@@ -258,12 +268,12 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
// Used by unit tests to exercise behavior without allocating huge chunks
// of memory.
size_t max_put_value_size_ = kMaxIDBMessageSizeInBytes;
-
// Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be
// destroyed and used on the same thread it was created on.
IDMap<blink::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_;
IDMap<blink::WebIDBDatabaseCallbacks, IDMapOwnPointer>
pending_database_callbacks_;
+ IDMap<blink::WebIDBObserver, IDMapOwnPointer> observers_;
// Maps the ipc_callback_id from an open cursor request to the request's
// transaction_id. Used to assign the transaction_id to the WebIDBCursorImpl
@@ -272,7 +282,6 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
// Map from cursor id to WebIDBCursorImpl.
std::map<int32_t, WebIDBCursorImpl*> cursors_;
-
std::map<int32_t, WebIDBDatabaseImpl*> databases_;
DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher);

Powered by Google App Engine
This is Rietveld 408576698