Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: content/browser/indexed_db/indexed_db_cursor.cc

Issue 1074493002: IndexedDB: Added IDBObjectStore.getAll() implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using IPC::Channel::kMaximumMessageSize in lieu of 10MB. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698