| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 int number_to_fetch, | 114 int number_to_fetch, |
| 115 scoped_refptr<IndexedDBCallbacks> callbacks, | 115 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 116 IndexedDBTransaction* /*transaction*/) { | 116 IndexedDBTransaction* /*transaction*/) { |
| 117 IDB_TRACE("IndexedDBCursor::CursorPrefetchIterationOperation"); | 117 IDB_TRACE("IndexedDBCursor::CursorPrefetchIterationOperation"); |
| 118 | 118 |
| 119 std::vector<IndexedDBKey> found_keys; | 119 std::vector<IndexedDBKey> found_keys; |
| 120 std::vector<IndexedDBKey> found_primary_keys; | 120 std::vector<IndexedDBKey> found_primary_keys; |
| 121 std::vector<IndexedDBValue> found_values; | 121 std::vector<IndexedDBValue> found_values; |
| 122 | 122 |
| 123 saved_cursor_.reset(); | 123 saved_cursor_.reset(); |
| 124 // TODO(cmumford): Use IPC::Channel::kMaximumMessageSize |
| 124 const size_t max_size_estimate = 10 * 1024 * 1024; | 125 const size_t max_size_estimate = 10 * 1024 * 1024; |
| 125 size_t size_estimate = 0; | 126 size_t size_estimate = 0; |
| 126 leveldb::Status s; | 127 leveldb::Status s; |
| 127 | 128 |
| 128 // TODO(cmumford): Handle this error (crbug.com/363397). Although this will | 129 // TODO(cmumford): Handle this error (crbug.com/363397). Although this will |
| 129 // properly fail, caller will not know why, and any corruption | 130 // properly fail, caller will not know why, and any corruption |
| 130 // will be ignored. | 131 // will be ignored. |
| 131 for (int i = 0; i < number_to_fetch; ++i) { | 132 for (int i = 0; i < number_to_fetch; ++i) { |
| 132 if (!cursor_ || !cursor_->Continue(&s)) { | 133 if (!cursor_ || !cursor_->Continue(&s)) { |
| 133 cursor_.reset(); | 134 cursor_.reset(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 196 } |
| 196 | 197 |
| 197 void IndexedDBCursor::Close() { | 198 void IndexedDBCursor::Close() { |
| 198 IDB_TRACE("IndexedDBCursor::Close"); | 199 IDB_TRACE("IndexedDBCursor::Close"); |
| 199 closed_ = true; | 200 closed_ = true; |
| 200 cursor_.reset(); | 201 cursor_.reset(); |
| 201 saved_cursor_.reset(); | 202 saved_cursor_.reset(); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace content | 205 } // namespace content |
| OLD | NEW |