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

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

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final architechture 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
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.h ('k') | content/child/indexed_db/webidbdatabase_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/indexed_db/indexed_db_dispatcher.cc
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index aa40cca350f2e8548188b939f202ec53a261f290..7d6196c637d58a625027c509e93055c00d1588d4 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -30,6 +30,7 @@ using blink::WebIDBDatabaseCallbacks;
using blink::WebIDBDatabaseError;
using blink::WebIDBKey;
using blink::WebIDBMetadata;
+using blink::WebIDBObserver;
using blink::WebIDBValue;
using blink::WebString;
using blink::WebVector;
@@ -167,6 +168,32 @@ bool IndexedDBDispatcher::Send(IPC::Message* msg) {
return thread_safe_sender_->Send(msg);
}
+int32_t IndexedDBDispatcher::AddIDBObserver(
+ int32_t ipc_database_id,
+ int64_t transaction_id,
+ std::unique_ptr<WebIDBObserver> observer) {
+ int32_t observer_id = observers_.Add(observer.release());
+ Send(new IndexedDBHostMsg_DatabaseObserve(ipc_database_id, transaction_id,
+ observer_id));
+ return observer_id;
+}
+
+void IndexedDBDispatcher::RemoveIDBObserversFromDatabase(
+ int32_t ipc_database_id,
+ const std::vector<int32_t>& observer_ids_to_remove) {
+ for (int32_t id_to_remove : observer_ids_to_remove) {
+ observers_.Remove(id_to_remove);
+ }
+ Send(new IndexedDBHostMsg_DatabaseUnobserve(ipc_database_id,
+ observer_ids_to_remove));
+}
+
+void IndexedDBDispatcher::RemoveIDBObservers(
+ const std::set<int32_t>& observer_ids_to_remove) {
+ for (int32_t id : observer_ids_to_remove)
+ observers_.Remove(id);
+}
+
void IndexedDBDispatcher::RequestIDBCursorAdvance(
unsigned long count,
WebIDBCallbacks* callbacks_ptr,
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.h ('k') | content/child/indexed_db/webidbdatabase_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698