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/proxy_webidbcursor_impl.h" | 5 #include "content/child/indexed_db/proxy_webidbcursor_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "content/child/thread_safe_sender.h" | 9 #include "content/child/thread_safe_sender.h" |
10 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 10 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const std::vector<IndexedDBKey>& primary_keys, | 109 const std::vector<IndexedDBKey>& primary_keys, |
110 const std::vector<WebData>& values) { | 110 const std::vector<WebData>& values) { |
111 prefetch_keys_.assign(keys.begin(), keys.end()); | 111 prefetch_keys_.assign(keys.begin(), keys.end()); |
112 prefetch_primary_keys_.assign(primary_keys.begin(), primary_keys.end()); | 112 prefetch_primary_keys_.assign(primary_keys.begin(), primary_keys.end()); |
113 prefetch_values_.assign(values.begin(), values.end()); | 113 prefetch_values_.assign(values.begin(), values.end()); |
114 | 114 |
115 used_prefetches_ = 0; | 115 used_prefetches_ = 0; |
116 pending_onsuccess_callbacks_ = 0; | 116 pending_onsuccess_callbacks_ = 0; |
117 } | 117 } |
118 | 118 |
119 void RendererWebIDBCursorImpl::CachedContinue( | 119 void RendererWebIDBCursorImpl::CachedContinue(WebIDBCallbacks* callbacks) { |
120 WebKit::WebIDBCallbacks* callbacks) { | |
121 DCHECK_GT(prefetch_keys_.size(), 0ul); | 120 DCHECK_GT(prefetch_keys_.size(), 0ul); |
122 DCHECK(prefetch_primary_keys_.size() == prefetch_keys_.size()); | 121 DCHECK(prefetch_primary_keys_.size() == prefetch_keys_.size()); |
123 DCHECK(prefetch_values_.size() == prefetch_keys_.size()); | 122 DCHECK(prefetch_values_.size() == prefetch_keys_.size()); |
124 | 123 |
125 IndexedDBKey key = prefetch_keys_.front(); | 124 IndexedDBKey key = prefetch_keys_.front(); |
126 IndexedDBKey primary_key = prefetch_primary_keys_.front(); | 125 IndexedDBKey primary_key = prefetch_primary_keys_.front(); |
127 // this could be a real problem.. we need 2 CachedContinues | 126 // this could be a real problem.. we need 2 CachedContinues |
128 WebData value = prefetch_values_.front(); | 127 WebData value = prefetch_values_.front(); |
129 | 128 |
130 prefetch_keys_.pop_front(); | 129 prefetch_keys_.pop_front(); |
(...skipping 20 matching lines...) Expand all Loading... |
151 dispatcher->RequestIDBCursorPrefetchReset( | 150 dispatcher->RequestIDBCursorPrefetchReset( |
152 used_prefetches_, prefetch_keys_.size(), ipc_cursor_id_); | 151 used_prefetches_, prefetch_keys_.size(), ipc_cursor_id_); |
153 prefetch_keys_.clear(); | 152 prefetch_keys_.clear(); |
154 prefetch_primary_keys_.clear(); | 153 prefetch_primary_keys_.clear(); |
155 prefetch_values_.clear(); | 154 prefetch_values_.clear(); |
156 | 155 |
157 pending_onsuccess_callbacks_ = 0; | 156 pending_onsuccess_callbacks_ = 0; |
158 } | 157 } |
159 | 158 |
160 } // namespace content | 159 } // namespace content |
OLD | NEW |