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

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

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle the rest of Josh's feedback. Created 7 years 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 | Annotate | Revision Log
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/proxy_webidbdatabase_impl.h" 5 #include "content/child/indexed_db/proxy_webidbdatabase_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
10 #include "content/child/indexed_db/indexed_db_dispatcher.h" 10 #include "content/child/indexed_db/indexed_db_dispatcher.h"
11 #include "content/child/indexed_db/indexed_db_key_builders.h" 11 #include "content/child/indexed_db/indexed_db_key_builders.h"
12 #include "content/common/indexed_db/indexed_db_messages.h" 12 #include "content/common/indexed_db/indexed_db_messages.h"
13 #include "third_party/WebKit/public/platform/WebBlobInfo.h"
13 #include "third_party/WebKit/public/platform/WebIDBKeyPath.h" 14 #include "third_party/WebKit/public/platform/WebIDBKeyPath.h"
14 #include "third_party/WebKit/public/platform/WebIDBMetadata.h" 15 #include "third_party/WebKit/public/platform/WebIDBMetadata.h"
15 #include "third_party/WebKit/public/platform/WebString.h" 16 #include "third_party/WebKit/public/platform/WebString.h"
16 #include "third_party/WebKit/public/platform/WebVector.h" 17 #include "third_party/WebKit/public/platform/WebVector.h"
17 #include "webkit/child/worker_task_runner.h" 18 #include "webkit/child/worker_task_runner.h"
18 19
20 using blink::WebBlobInfo;
19 using blink::WebIDBCallbacks; 21 using blink::WebIDBCallbacks;
20 using blink::WebIDBDatabaseCallbacks; 22 using blink::WebIDBDatabaseCallbacks;
21 using blink::WebIDBMetadata; 23 using blink::WebIDBMetadata;
22 using blink::WebIDBKey; 24 using blink::WebIDBKey;
23 using blink::WebIDBKeyPath; 25 using blink::WebIDBKeyPath;
24 using blink::WebIDBKeyRange; 26 using blink::WebIDBKeyRange;
25 using blink::WebString; 27 using blink::WebString;
26 using blink::WebVector; 28 using blink::WebVector;
27 using webkit_glue::WorkerTaskRunner; 29 using webkit_glue::WorkerTaskRunner;
28 30
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 index_id, 112 index_id,
111 IndexedDBKeyRangeBuilder::Build(key_range), 113 IndexedDBKeyRangeBuilder::Build(key_range),
112 key_only, 114 key_only,
113 callbacks); 115 callbacks);
114 } 116 }
115 117
116 void RendererWebIDBDatabaseImpl::put( 118 void RendererWebIDBDatabaseImpl::put(
117 long long transaction_id, 119 long long transaction_id,
118 long long object_store_id, 120 long long object_store_id,
119 const blink::WebData& value, 121 const blink::WebData& value,
122 const blink::WebVector<WebBlobInfo>& webBlobInfo,
120 const WebIDBKey& key, 123 const WebIDBKey& key,
121 PutMode put_mode, 124 PutMode put_mode,
122 WebIDBCallbacks* callbacks, 125 WebIDBCallbacks* callbacks,
123 const WebVector<long long>& web_index_ids, 126 const WebVector<long long>& web_index_ids,
124 const WebVector<WebIndexKeys>& web_index_keys) { 127 const WebVector<WebIndexKeys>& web_index_keys) {
125 IndexedDBDispatcher* dispatcher = 128 IndexedDBDispatcher* dispatcher =
126 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 129 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
127 dispatcher->RequestIDBDatabasePut(ipc_database_id_, 130 dispatcher->RequestIDBDatabasePut(ipc_database_id_,
128 transaction_id, 131 transaction_id,
129 object_store_id, 132 object_store_id,
130 value, 133 value,
134 webBlobInfo,
131 IndexedDBKeyBuilder::Build(key), 135 IndexedDBKeyBuilder::Build(key),
132 put_mode, 136 put_mode,
133 callbacks, 137 callbacks,
134 web_index_ids, 138 web_index_ids,
135 web_index_keys); 139 web_index_keys);
136 } 140 }
137 141
138 void RendererWebIDBDatabaseImpl::setIndexKeys( 142 void RendererWebIDBDatabaseImpl::setIndexKeys(
139 long long transaction_id, 143 long long transaction_id,
140 long long object_store_id, 144 long long object_store_id,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void RendererWebIDBDatabaseImpl::abort(long long transaction_id) { 277 void RendererWebIDBDatabaseImpl::abort(long long transaction_id) {
274 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseAbort( 278 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseAbort(
275 ipc_database_id_, transaction_id)); 279 ipc_database_id_, transaction_id));
276 } 280 }
277 281
278 void RendererWebIDBDatabaseImpl::commit(long long transaction_id) { 282 void RendererWebIDBDatabaseImpl::commit(long long transaction_id) {
279 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseCommit( 283 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseCommit(
280 ipc_database_id_, transaction_id)); 284 ipc_database_id_, transaction_id));
281 } 285 }
282 286
287 void RendererWebIDBDatabaseImpl::ackReceivedBlobs(
288 const WebVector<WebString>& uuids) {
289 DCHECK(uuids.size());
290 std::vector<std::string> param(uuids.size());
291 for (size_t i = 0; i < uuids.size(); ++i) {
jsbell 2013/12/20 00:44:20 Nit: Don't need braces.
ericu 2014/02/20 00:50:29 Done.
292 param[i] = uuids[i].latin1().data();
293 }
294 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param));
295 }
296
283 } // namespace content 297 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698