OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/indexed_db/indexed_db_cursor.h" | 5 #include "content/browser/indexed_db/indexed_db_cursor.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 if (size_estimate > max_size_estimate) | 163 if (size_estimate > max_size_estimate) |
164 break; | 164 break; |
165 } | 165 } |
166 | 166 |
167 if (!found_keys.size()) { | 167 if (!found_keys.size()) { |
168 callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL)); | 168 callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL)); |
169 return; | 169 return; |
170 } | 170 } |
171 | 171 |
172 callbacks->OnSuccessWithPrefetch( | 172 callbacks->OnSuccessWithPrefetch( |
173 found_keys, found_primary_keys, found_values); | 173 found_keys, found_primary_keys, &found_values); |
174 } | 174 } |
175 | 175 |
176 leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, | 176 leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, |
177 int /* unused_prefetches */) { | 177 int /* unused_prefetches */) { |
178 IDB_TRACE("IndexedDBCursor::PrefetchReset"); | 178 IDB_TRACE("IndexedDBCursor::PrefetchReset"); |
179 cursor_.swap(saved_cursor_); | 179 cursor_.swap(saved_cursor_); |
180 saved_cursor_.reset(); | 180 saved_cursor_.reset(); |
181 leveldb::Status s; | 181 leveldb::Status s; |
182 | 182 |
183 if (closed_) | 183 if (closed_) |
(...skipping 11 matching lines...) Expand all Loading... |
195 } | 195 } |
196 | 196 |
197 void IndexedDBCursor::Close() { | 197 void IndexedDBCursor::Close() { |
198 IDB_TRACE("IndexedDBCursor::Close"); | 198 IDB_TRACE("IndexedDBCursor::Close"); |
199 closed_ = true; | 199 closed_ = true; |
200 cursor_.reset(); | 200 cursor_.reset(); |
201 saved_cursor_.reset(); | 201 saved_cursor_.reset(); |
202 } | 202 } |
203 | 203 |
204 } // namespace content | 204 } // namespace content |
OLD | NEW |