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..27f7dc2dcd2c5fb948304915d3d5076baec01c20 100644 |
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc |
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc |
@@ -23,6 +23,8 @@ |
#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_observation.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" |
@@ -188,6 +190,7 @@ int32_t IndexedDBDispatcherHost::Add(IndexedDBConnection* connection, |
return -1; |
} |
int32_t ipc_database_id = database_dispatcher_host_->map_.Add(connection); |
+ connection->setId(ipc_database_id); |
context()->ConnectionOpened(origin, connection); |
database_dispatcher_host_->database_origin_map_[ipc_database_id] = origin; |
return ipc_database_id; |
@@ -317,6 +320,26 @@ IndexedDBCursor* IndexedDBDispatcherHost::GetCursorFromId( |
return metadata; |
} |
+::IndexedDBObserverChanges IndexedDBDispatcherHost::ConvertObserverChanges( |
+ std::unique_ptr<content::IndexedDBObserverChanges> changes) { |
+ ::IndexedDBObserverChanges idb_changes; |
+ // TODO(palakj): Move the map instead of copying? |
+ idb_changes.observation_index = changes->observation_index(); |
dmurph
2016/07/08 23:51:40
Since you grab a unique_ptr, you can safely do an
palakj1
2016/07/11 05:33:26
Done.
|
+ for (auto& iter : changes->observations()) { |
+ idb_changes.observations.push_back(ConvertObservation(std::move(iter))); |
+ } |
+ return idb_changes; |
+} |
+ |
+::IndexedDBObservation IndexedDBDispatcherHost::ConvertObservation( |
+ std::unique_ptr<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()); |