| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 default: | 160 default: |
| 161 NOTREACHED(); | 161 NOTREACHED(); |
| 162 } | 162 } |
| 163 size_estimate += cursor_->key().size_estimate(); | 163 size_estimate += cursor_->key().size_estimate(); |
| 164 size_estimate += cursor_->primary_key().size_estimate(); | 164 size_estimate += cursor_->primary_key().size_estimate(); |
| 165 | 165 |
| 166 if (size_estimate > max_size_estimate) | 166 if (size_estimate > max_size_estimate) |
| 167 break; | 167 break; |
| 168 } | 168 } |
| 169 | 169 |
| 170 if (!found_keys.size()) { | 170 if (found_keys.empty()) { |
| 171 callbacks->OnSuccess(nullptr); | 171 callbacks->OnSuccess(nullptr); |
| 172 return; | 172 return; |
| 173 } | 173 } |
| 174 | 174 |
| 175 callbacks->OnSuccessWithPrefetch( | 175 callbacks->OnSuccessWithPrefetch( |
| 176 found_keys, found_primary_keys, &found_values); | 176 found_keys, found_primary_keys, &found_values); |
| 177 } | 177 } |
| 178 | 178 |
| 179 leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, | 179 leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, |
| 180 int /* unused_prefetches */) { | 180 int /* unused_prefetches */) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 void IndexedDBCursor::Close() { | 200 void IndexedDBCursor::Close() { |
| 201 IDB_TRACE("IndexedDBCursor::Close"); | 201 IDB_TRACE("IndexedDBCursor::Close"); |
| 202 closed_ = true; | 202 closed_ = true; |
| 203 cursor_.reset(); | 203 cursor_.reset(); |
| 204 saved_cursor_.reset(); | 204 saved_cursor_.reset(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace content | 207 } // namespace content |
| OLD | NEW |