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

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

Issue 2160163002: [IndexedDB] Propogating Changes to Observer : Browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expected tests updated 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 bool IndexedDBDispatcher::Send(IPC::Message* msg) { 167 bool IndexedDBDispatcher::Send(IPC::Message* msg) {
168 return thread_safe_sender_->Send(msg); 168 return thread_safe_sender_->Send(msg);
169 } 169 }
170 170
171 int32_t IndexedDBDispatcher::AddIDBObserver( 171 int32_t IndexedDBDispatcher::AddIDBObserver(
172 int32_t ipc_database_id, 172 int32_t ipc_database_id,
173 int64_t transaction_id, 173 int64_t transaction_id,
174 std::unique_ptr<WebIDBObserver> observer) { 174 std::unique_ptr<WebIDBObserver> observer) {
175 int32_t observer_id = observers_.Add(observer.release()); 175 int32_t observer_id = observers_.Add(observer.release());
176 Send(new IndexedDBHostMsg_DatabaseObserve(ipc_database_id, transaction_id, 176 IndexedDBHostMsg_DatabaseObserve_Params params;
177 observer_id)); 177 // TODO(palakj): Other params are assigned values as a part of next cl.
178 params.ipc_database_id = ipc_database_id;
179 params.transaction_id = transaction_id;
180 params.observer_id = observer_id;
181 Send(new IndexedDBHostMsg_DatabaseObserve(params));
178 return observer_id; 182 return observer_id;
179 } 183 }
180 184
181 void IndexedDBDispatcher::RemoveIDBObserversFromDatabase( 185 void IndexedDBDispatcher::RemoveIDBObserversFromDatabase(
182 int32_t ipc_database_id, 186 int32_t ipc_database_id,
183 const std::vector<int32_t>& observer_ids_to_remove) { 187 const std::vector<int32_t>& observer_ids_to_remove) {
184 for (int32_t id_to_remove : observer_ids_to_remove) { 188 for (int32_t id_to_remove : observer_ids_to_remove) {
185 observers_.Remove(id_to_remove); 189 observers_.Remove(id_to_remove);
186 } 190 }
187 Send(new IndexedDBHostMsg_DatabaseUnobserve(ipc_database_id, 191 Send(new IndexedDBHostMsg_DatabaseUnobserve(ipc_database_id,
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator; 831 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator;
828 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { 832 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) {
829 if (i->first == ipc_exception_cursor_id || 833 if (i->first == ipc_exception_cursor_id ||
830 i->second->transaction_id() != transaction_id) 834 i->second->transaction_id() != transaction_id)
831 continue; 835 continue;
832 i->second->ResetPrefetchCache(); 836 i->second->ResetPrefetchCache();
833 } 837 }
834 } 838 }
835 839
836 } // namespace content 840 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction_unittest.cc ('k') | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698