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

Side by Side Diff: content/child/indexed_db/webidbdatabase_impl.cc

Issue 1074493002: IndexedDB: Added IDBObjectStore.getAll() implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unused indexId/keyOnly parameters to getAll. 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 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/webidbdatabase_impl.h" 5 #include "content/child/indexed_db/webidbdatabase_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/child/indexed_db/indexed_db_dispatcher.h" 10 #include "content/child/indexed_db/indexed_db_dispatcher.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 108 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
109 dispatcher->RequestIDBDatabaseGet(ipc_database_id_, 109 dispatcher->RequestIDBDatabaseGet(ipc_database_id_,
110 transaction_id, 110 transaction_id,
111 object_store_id, 111 object_store_id,
112 index_id, 112 index_id,
113 IndexedDBKeyRangeBuilder::Build(key_range), 113 IndexedDBKeyRangeBuilder::Build(key_range),
114 key_only, 114 key_only,
115 callbacks); 115 callbacks);
116 } 116 }
117 117
118 void WebIDBDatabaseImpl::getAll(long long transaction_id,
119 long long object_store_id,
120 long long index_id,
121 const WebIDBKeyRange& key_range,
122 long long max_count,
123 bool key_only,
124 WebIDBCallbacks* callbacks) {
125 // TODO(cmumford): Remove DCHECK's for index_id/key_only once IDBIndex.getAll
126 // is implemented.
127 static const int64 kInvalidId = -1;
128 DCHECK_EQ(kInvalidId, index_id);
129 DCHECK(!key_only);
130 IndexedDBDispatcher* dispatcher =
131 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
132 dispatcher->RequestIDBDatabaseGetAll(
133 ipc_database_id_, transaction_id, object_store_id,
134 IndexedDBKeyRangeBuilder::Build(key_range), max_count, callbacks);
135 }
136
118 void WebIDBDatabaseImpl::put(long long transaction_id, 137 void WebIDBDatabaseImpl::put(long long transaction_id,
119 long long object_store_id, 138 long long object_store_id,
120 const blink::WebData& value, 139 const blink::WebData& value,
121 const blink::WebVector<WebBlobInfo>& web_blob_info, 140 const blink::WebVector<WebBlobInfo>& web_blob_info,
122 const WebIDBKey& key, 141 const WebIDBKey& key,
123 blink::WebIDBPutMode put_mode, 142 blink::WebIDBPutMode put_mode,
124 WebIDBCallbacks* callbacks, 143 WebIDBCallbacks* callbacks,
125 const WebVector<long long>& web_index_ids, 144 const WebVector<long long>& web_index_ids,
126 const WebVector<WebIndexKeys>& web_index_keys) { 145 const WebVector<WebIndexKeys>& web_index_keys) {
127 IndexedDBDispatcher* dispatcher = 146 IndexedDBDispatcher* dispatcher =
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 293
275 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { 294 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) {
276 DCHECK(uuids.size()); 295 DCHECK(uuids.size());
277 std::vector<std::string> param(uuids.size()); 296 std::vector<std::string> param(uuids.size());
278 for (size_t i = 0; i < uuids.size(); ++i) 297 for (size_t i = 0; i < uuids.size(); ++i)
279 param[i] = uuids[i].latin1().data(); 298 param[i] = uuids[i].latin1().data();
280 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); 299 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param));
281 } 300 }
282 301
283 } // namespace content 302 } // namespace content
OLDNEW
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.h ('k') | content/common/indexed_db/indexed_db_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698