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

Unified Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Filtering Changes to Observer : Browser End 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
Index: content/browser/indexed_db/indexed_db_dispatcher_host.cc
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index aac0dd9381135acfa6393bc6c5ccbd0fa173b308..90db0d670205af90ec6851dd84ac6a0f45c898ee 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -23,10 +23,12 @@
#include "content/browser/indexed_db/indexed_db_cursor.h"
#include "content/browser/indexed_db/indexed_db_database_callbacks.h"
#include "content/browser/indexed_db/indexed_db_metadata.h"
+#include "content/browser/indexed_db/indexed_db_observer_changes.h"
#include "content/browser/indexed_db/indexed_db_pending_connection.h"
#include "content/browser/indexed_db/indexed_db_value.h"
#include "content/browser/renderer_host/render_message_filter.h"
#include "content/common/indexed_db/indexed_db_messages.h"
+#include "content/common/indexed_db/indexed_db_observation.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
@@ -317,6 +319,26 @@ IndexedDBCursor* IndexedDBDispatcherHost::GetCursorFromId(
return metadata;
}
+::IndexedDBObserverChanges IndexedDBDispatcherHost::ConvertObserverChanges(
+ content::IndexedDBObserverChanges* changes) {
+ ::IndexedDBObserverChanges idb_changes;
+ // TODO(palakj): Move the map instead of copying?
+ idb_changes.observation_index = changes->observation_index;
+ for (auto& iter : changes->observations) {
+ ::IndexedDBObservation idb_observation = ConvertObservation(iter.release());
+ }
+ return idb_changes;
+}
+
+::IndexedDBObservation IndexedDBDispatcherHost::ConvertObservation(
+ content::IndexedDBObservation* observation) {
+ // TODO(palakj): Modify function for different observation constructors.
+ ::IndexedDBObservation idb_observation;
+ idb_observation.type = observation->type();
+ idb_observation.key_range = observation->key_range();
+ return idb_observation;
+}
+
void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) {
DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698