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

Side by Side Diff: content/common/indexed_db/proxy_webidbobjectstore_impl.cc

Issue 10830228: Chromium glue for Preemptive cursors and passing keys from renderer to browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/indexed_db/proxy_webidbobjectstore_impl.h" 5 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h"
6 6
7 #include "content/common/indexed_db/indexed_db_messages.h" 7 #include "content/common/indexed_db/indexed_db_messages.h"
8 #include "content/public/common/serialized_script_value.h" 8 #include "content/public/common/serialized_script_value.h"
9 #include "content/common/indexed_db/indexed_db_dispatcher.h" 9 #include "content/common/indexed_db/indexed_db_dispatcher.h"
10 #include "content/common/indexed_db/proxy_webidbindex_impl.h" 10 #include "content/common/indexed_db/proxy_webidbindex_impl.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const WebVector<WebVector<WebIDBKey> >& indexKeys, 71 const WebVector<WebVector<WebIDBKey> >& indexKeys,
72 WebExceptionCode& ec) { 72 WebExceptionCode& ec) {
73 IndexedDBDispatcher* dispatcher = 73 IndexedDBDispatcher* dispatcher =
74 IndexedDBDispatcher::ThreadSpecificInstance(); 74 IndexedDBDispatcher::ThreadSpecificInstance();
75 dispatcher->RequestIDBObjectStorePut( 75 dispatcher->RequestIDBObjectStorePut(
76 SerializedScriptValue(value), IndexedDBKey(key), 76 SerializedScriptValue(value), IndexedDBKey(key),
77 put_mode, callbacks, idb_object_store_id_, transaction, 77 put_mode, callbacks, idb_object_store_id_, transaction,
78 indexNames, indexKeys, &ec); 78 indexNames, indexKeys, &ec);
79 } 79 }
80 80
81 void RendererWebIDBObjectStoreImpl::setIndexKeys(
82 const WebKit::WebIDBKey& primaryKey,
83 const WebKit::WebVector<WebKit::WebString>& indexNames,
84 const WebKit::WebVector<WebIndexKeys>& indexKeys,
85 const WebKit::WebIDBTransaction& transaction) {
86 IndexedDBDispatcher* dispatcher =
87 IndexedDBDispatcher::ThreadSpecificInstance();
88 dispatcher->RequestIDBObjectStoreSetIndexKeys(
89 idb_object_store_id_, IndexedDBKey(primaryKey), indexNames, indexKeys,
90 transaction);
91 }
92
93 void RendererWebIDBObjectStoreImpl::setIndexesReady(
94 const WebKit::WebVector<WebKit::WebString>& indexNames,
95 const WebKit::WebIDBTransaction& transaction) {
96 IndexedDBDispatcher* dispatcher =
97 IndexedDBDispatcher::ThreadSpecificInstance();
98 dispatcher->RequestIDBObjectStoreSetIndexesReady(
99 idb_object_store_id_, indexNames, transaction);
100 }
101
102
81 void RendererWebIDBObjectStoreImpl::deleteFunction( 103 void RendererWebIDBObjectStoreImpl::deleteFunction(
82 const WebIDBKeyRange& key_range, 104 const WebIDBKeyRange& key_range,
83 WebIDBCallbacks* callbacks, 105 WebIDBCallbacks* callbacks,
84 const WebIDBTransaction& transaction, 106 const WebIDBTransaction& transaction,
85 WebExceptionCode& ec) { 107 WebExceptionCode& ec) {
86 IndexedDBDispatcher* dispatcher = 108 IndexedDBDispatcher* dispatcher =
87 IndexedDBDispatcher::ThreadSpecificInstance(); 109 IndexedDBDispatcher::ThreadSpecificInstance();
88 dispatcher->RequestIDBObjectStoreDelete( 110 dispatcher->RequestIDBObjectStoreDelete(
89 IndexedDBKeyRange(key_range), callbacks, idb_object_store_id_, 111 IndexedDBKeyRange(key_range), callbacks, idb_object_store_id_,
90 transaction, &ec); 112 transaction, &ec);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const WebIDBTransaction& transaction, 162 const WebIDBTransaction& transaction,
141 WebExceptionCode& ec) { 163 WebExceptionCode& ec) {
142 IndexedDBDispatcher::Send( 164 IndexedDBDispatcher::Send(
143 new IndexedDBHostMsg_ObjectStoreDeleteIndex( 165 new IndexedDBHostMsg_ObjectStoreDeleteIndex(
144 idb_object_store_id_, name, 166 idb_object_store_id_, name,
145 IndexedDBDispatcher::TransactionId(transaction), &ec)); 167 IndexedDBDispatcher::TransactionId(transaction), &ec));
146 } 168 }
147 169
148 void RendererWebIDBObjectStoreImpl::openCursor( 170 void RendererWebIDBObjectStoreImpl::openCursor(
149 const WebIDBKeyRange& idb_key_range, 171 const WebIDBKeyRange& idb_key_range,
172 WebKit::WebIDBCursor::Direction direction, WebIDBCallbacks* callbacks,
173 WebKit::WebIDBTransaction::TaskType task_type,
174 const WebIDBTransaction& transaction,
175 WebExceptionCode& ec) {
176 IndexedDBDispatcher* dispatcher =
177 IndexedDBDispatcher::ThreadSpecificInstance();
178 dispatcher->RequestIDBObjectStoreOpenCursor(
179 idb_key_range, direction, callbacks, idb_object_store_id_,
180 task_type, transaction, &ec);
181 }
182
183 void RendererWebIDBObjectStoreImpl::openCursor(
184 const WebIDBKeyRange& idb_key_range,
150 unsigned short direction, WebIDBCallbacks* callbacks, 185 unsigned short direction, WebIDBCallbacks* callbacks,
151 const WebIDBTransaction& transaction, 186 const WebIDBTransaction& transaction,
152 WebExceptionCode& ec) { 187 WebExceptionCode& ec) {
153 IndexedDBDispatcher* dispatcher = 188 IndexedDBDispatcher* dispatcher =
154 IndexedDBDispatcher::ThreadSpecificInstance(); 189 IndexedDBDispatcher::ThreadSpecificInstance();
155 dispatcher->RequestIDBObjectStoreOpenCursor( 190 dispatcher->RequestIDBObjectStoreOpenCursor(
156 idb_key_range, direction, callbacks, idb_object_store_id_, 191 idb_key_range, static_cast<WebKit::WebIDBCursor::Direction>(direction),
157 transaction, &ec); 192 callbacks, idb_object_store_id_,
193 WebKit::WebIDBTransaction::NormalTask, transaction, &ec);
158 } 194 }
159 195
160 void RendererWebIDBObjectStoreImpl::count( 196 void RendererWebIDBObjectStoreImpl::count(
161 const WebIDBKeyRange& idb_key_range, 197 const WebIDBKeyRange& idb_key_range,
162 WebIDBCallbacks* callbacks, 198 WebIDBCallbacks* callbacks,
163 const WebIDBTransaction& transaction, 199 const WebIDBTransaction& transaction,
164 WebExceptionCode& ec) { 200 WebExceptionCode& ec) {
165 IndexedDBDispatcher* dispatcher = 201 IndexedDBDispatcher* dispatcher =
166 IndexedDBDispatcher::ThreadSpecificInstance(); 202 IndexedDBDispatcher::ThreadSpecificInstance();
167 dispatcher->RequestIDBObjectStoreCount( 203 dispatcher->RequestIDBObjectStoreCount(
168 idb_key_range, callbacks, idb_object_store_id_, 204 idb_key_range, callbacks, idb_object_store_id_,
169 transaction, &ec); 205 transaction, &ec);
170 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698