Chromium Code Reviews| 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..73dd35e93f36a8e4238fa256b2608cb48c65867e 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,27 @@ IndexedDBCursor* IndexedDBDispatcherHost::GetCursorFromId( |
| return metadata; |
| } |
| +::IndexedDBMsg_ObserverChanges IndexedDBDispatcherHost::ConvertObserverChanges( |
|
jsbell
2016/07/11 18:25:33
Is the leading :: needed here? Its only used in Co
palakj1
2016/07/11 22:25:40
Done.
|
| + std::unique_ptr<content::IndexedDBObserverChanges> changes) { |
|
jsbell
2016/07/11 18:25:33
Similarly, I don't think you need content:: here
palakj1
2016/07/11 22:25:40
Done.
|
| + ::IndexedDBMsg_ObserverChanges idb_changes; |
| + idb_changes.observation_index = changes->observation_index(); |
| + for (auto& observation : changes->observations()) { |
| + idb_changes.observations.push_back( |
| + ConvertObservation(std::move(observation))); |
|
jsbell
2016/07/11 18:25:33
It's subtle that this is freeing the observations
palakj1
2016/07/11 22:25:40
done.
|
| + } |
| + return idb_changes; |
| +} |
| + |
| +::IndexedDBMsg_Observation IndexedDBDispatcherHost::ConvertObservation( |
| + std::unique_ptr<content::IndexedDBObservation> observation) { |
|
jsbell
2016/07/11 18:25:33
Since this is not transferring ownership, can this
palakj1
2016/07/11 22:25:40
Done.
|
| + // TODO(palakj): Modify function for indexed_db_value. |
| + ::IndexedDBMsg_Observation idb_observation; |
| + idb_observation.object_store_id = observation->object_store_id(); |
| + 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()); |