OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |