| 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 96cad054d68c0110179e1aeb1e3a8c516ae73e60..aac0dd9381135acfa6393bc6c5ccbd0fa173b308 100644
|
| --- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
|
| +++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
|
| @@ -520,6 +520,8 @@ bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived(
|
| IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseVersionChangeIgnored,
|
| OnVersionChangeIgnored)
|
| IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed)
|
| + IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseObserve, OnObserve)
|
| + IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseUnobserve, OnUnobserve)
|
| IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseGet, OnGet)
|
| IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseGetAll, OnGetAll)
|
| IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabasePut, OnPutWrapper)
|
| @@ -629,6 +631,31 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed(
|
| parent_->DestroyObject(&map_, ipc_object_id);
|
| }
|
|
|
| +void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnObserve(
|
| + int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int32_t observer_id) {
|
| + DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread());
|
| + IndexedDBConnection* connection =
|
| + parent_->GetOrTerminateProcess(&map_, ipc_database_id);
|
| + if (!connection || !connection->IsConnected())
|
| + return;
|
| + connection->database()->AddPendingObserver(
|
| + parent_->HostTransactionId(transaction_id), observer_id);
|
| +}
|
| +
|
| +void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnUnobserve(
|
| + int32_t ipc_database_id,
|
| + const std::vector<int32_t>& observer_ids_to_remove) {
|
| + DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread());
|
| + DCHECK(!observer_ids_to_remove.empty());
|
| + IndexedDBConnection* connection =
|
| + parent_->GetOrTerminateProcess(&map_, ipc_database_id);
|
| + if (!connection || !connection->IsConnected())
|
| + return;
|
| + connection->RemoveObservers(observer_ids_to_remove);
|
| +}
|
| +
|
| void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnGet(
|
| const IndexedDBHostMsg_DatabaseGet_Params& params) {
|
| DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread());
|
|
|