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

Side by Side Diff: content/child/indexed_db/indexed_db_dispatcher.cc

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Post dmurph review 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/indexed_db/indexed_db_dispatcher.h" 5 #include "content/child/indexed_db/indexed_db_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 OnSuccessUndefined) 149 OnSuccessUndefined)
150 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) 150 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError)
151 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked) 151 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked)
152 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksUpgradeNeeded, OnUpgradeNeeded) 152 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksUpgradeNeeded, OnUpgradeNeeded)
153 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksForcedClose, 153 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksForcedClose,
154 OnForcedClose) 154 OnForcedClose)
155 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksVersionChange, 155 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksVersionChange,
156 OnVersionChange) 156 OnVersionChange)
157 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksAbort, OnAbort) 157 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksAbort, OnAbort)
158 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksComplete, OnComplete) 158 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksComplete, OnComplete)
159 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksChanges, OnDatabaseChange)
159 IPC_MESSAGE_UNHANDLED(handled = false) 160 IPC_MESSAGE_UNHANDLED(handled = false)
160 IPC_END_MESSAGE_MAP() 161 IPC_END_MESSAGE_MAP()
161 // If a message gets here, IndexedDBMessageFilter already determined that it 162 // If a message gets here, IndexedDBMessageFilter already determined that it
162 // is an IndexedDB message. 163 // is an IndexedDB message.
163 DCHECK(handled) << "Didn't handle a message defined at line " 164 DCHECK(handled) << "Didn't handle a message defined at line "
164 << IPC_MESSAGE_ID_LINE(msg.type()); 165 << IPC_MESSAGE_ID_LINE(msg.type());
165 } 166 }
166 167
167 bool IndexedDBDispatcher::Send(IPC::Message* msg) { 168 bool IndexedDBDispatcher::Send(IPC::Message* msg) {
168 return thread_safe_sender_->Send(msg); 169 return thread_safe_sender_->Send(msg);
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 int32_t ipc_database_callbacks_id, 791 int32_t ipc_database_callbacks_id,
791 int64_t transaction_id) { 792 int64_t transaction_id) {
792 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); 793 DCHECK_EQ(ipc_thread_id, CurrentWorkerId());
793 WebIDBDatabaseCallbacks* callbacks = 794 WebIDBDatabaseCallbacks* callbacks =
794 pending_database_callbacks_.Lookup(ipc_database_callbacks_id); 795 pending_database_callbacks_.Lookup(ipc_database_callbacks_id);
795 if (!callbacks) 796 if (!callbacks)
796 return; 797 return;
797 callbacks->onComplete(transaction_id); 798 callbacks->onComplete(transaction_id);
798 } 799 }
799 800
801 void IndexedDBDispatcher::OnDatabaseChange(
802 int32_t ipc_thread_id,
803 int32_t ipc_database_callbacks_id,
804 const IndexedDBObserverChanges& changes_map) {
805 // for(auto& obs: changes_map.observation_index) {
dmurph 2016/07/08 23:51:40 Ah, so here we'll probably want to decompose to ea
palakj1 2016/07/11 05:33:26 Done.
806 // WebIDBObserver* observer = observers_.Lookup(obs.first);
807 // // Can shift this logic to blink.
808 //// observer->onChange(changes_map.observations, std::move(obs.second));
809 // }
810 }
811
800 void IndexedDBDispatcher::OnForcedClose(int32_t ipc_thread_id, 812 void IndexedDBDispatcher::OnForcedClose(int32_t ipc_thread_id,
801 int32_t ipc_database_callbacks_id) { 813 int32_t ipc_database_callbacks_id) {
802 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); 814 DCHECK_EQ(ipc_thread_id, CurrentWorkerId());
803 WebIDBDatabaseCallbacks* callbacks = 815 WebIDBDatabaseCallbacks* callbacks =
804 pending_database_callbacks_.Lookup(ipc_database_callbacks_id); 816 pending_database_callbacks_.Lookup(ipc_database_callbacks_id);
805 if (!callbacks) 817 if (!callbacks)
806 return; 818 return;
807 callbacks->onForcedClose(); 819 callbacks->onForcedClose();
808 } 820 }
809 821
(...skipping 17 matching lines...) Expand all
827 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator; 839 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator;
828 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { 840 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) {
829 if (i->first == ipc_exception_cursor_id || 841 if (i->first == ipc_exception_cursor_id ||
830 i->second->transaction_id() != transaction_id) 842 i->second->transaction_id() != transaction_id)
831 continue; 843 continue;
832 i->second->ResetPrefetchCache(); 844 i->second->ResetPrefetchCache();
833 } 845 }
834 } 846 }
835 847
836 } // namespace content 848 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698