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

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

Issue 229483003: WebBlobInfo plumbing for WebIDBDatabaseImpl::put. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rolled in Josh's feedback. Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <vector> 7 #include <vector>
8 8
9 #include "content/child/indexed_db/indexed_db_dispatcher.h" 9 #include "content/child/indexed_db/indexed_db_dispatcher.h"
10 #include "content/child/indexed_db/indexed_db_key_builders.h" 10 #include "content/child/indexed_db/indexed_db_key_builders.h"
11 #include "content/child/thread_safe_sender.h" 11 #include "content/child/thread_safe_sender.h"
12 #include "content/child/worker_task_runner.h" 12 #include "content/child/worker_task_runner.h"
13 #include "content/common/indexed_db/indexed_db_messages.h" 13 #include "content/common/indexed_db/indexed_db_messages.h"
14 #include "third_party/WebKit/public/platform/WebBlobInfo.h"
14 #include "third_party/WebKit/public/platform/WebIDBKeyPath.h" 15 #include "third_party/WebKit/public/platform/WebIDBKeyPath.h"
15 #include "third_party/WebKit/public/platform/WebIDBMetadata.h" 16 #include "third_party/WebKit/public/platform/WebIDBMetadata.h"
16 #include "third_party/WebKit/public/platform/WebString.h" 17 #include "third_party/WebKit/public/platform/WebString.h"
17 #include "third_party/WebKit/public/platform/WebVector.h" 18 #include "third_party/WebKit/public/platform/WebVector.h"
18 19
20 using blink::WebBlobInfo;
19 using blink::WebIDBCallbacks; 21 using blink::WebIDBCallbacks;
20 using blink::WebIDBCursor; 22 using blink::WebIDBCursor;
21 using blink::WebIDBDatabase; 23 using blink::WebIDBDatabase;
22 using blink::WebIDBDatabaseCallbacks; 24 using blink::WebIDBDatabaseCallbacks;
23 using blink::WebIDBMetadata; 25 using blink::WebIDBMetadata;
24 using blink::WebIDBKey; 26 using blink::WebIDBKey;
25 using blink::WebIDBKeyPath; 27 using blink::WebIDBKeyPath;
26 using blink::WebIDBKeyRange; 28 using blink::WebIDBKeyRange;
27 using blink::WebString; 29 using blink::WebString;
28 using blink::WebVector; 30 using blink::WebVector;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 101 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
100 dispatcher->RequestIDBDatabaseGet(ipc_database_id_, 102 dispatcher->RequestIDBDatabaseGet(ipc_database_id_,
101 transaction_id, 103 transaction_id,
102 object_store_id, 104 object_store_id,
103 index_id, 105 index_id,
104 IndexedDBKeyRangeBuilder::Build(key_range), 106 IndexedDBKeyRangeBuilder::Build(key_range),
105 key_only, 107 key_only,
106 callbacks); 108 callbacks);
107 } 109 }
108 110
111 // TODO(ericu): Remove this once it's obsolete. It's only here for the
112 // three-sided-patch dance.
109 void WebIDBDatabaseImpl::put(long long transaction_id, 113 void WebIDBDatabaseImpl::put(long long transaction_id,
110 long long object_store_id, 114 long long object_store_id,
111 const blink::WebData& value, 115 const blink::WebData& value,
112 const WebIDBKey& key, 116 const WebIDBKey& key,
113 PutMode put_mode, 117 PutMode put_mode,
114 WebIDBCallbacks* callbacks, 118 WebIDBCallbacks* callbacks,
115 const WebVector<long long>& web_index_ids, 119 const WebVector<long long>& web_index_ids,
116 const WebVector<WebIndexKeys>& web_index_keys) { 120 const WebVector<WebIndexKeys>& web_index_keys) {
117 IndexedDBDispatcher* dispatcher = 121 IndexedDBDispatcher* dispatcher =
118 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 122 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
123 const blink::WebVector<WebBlobInfo> web_blob_info;
124 dispatcher->RequestIDBDatabasePut(ipc_database_id_,
125 transaction_id,
126 object_store_id,
127 value,
128 web_blob_info,
129 IndexedDBKeyBuilder::Build(key),
130 put_mode,
131 callbacks,
132 web_index_ids,
133 web_index_keys);
134 }
135
136 void WebIDBDatabaseImpl::put(long long transaction_id,
137 long long object_store_id,
138 const blink::WebData& value,
139 const blink::WebVector<WebBlobInfo>& web_blob_info,
140 const WebIDBKey& key,
141 PutMode put_mode,
142 WebIDBCallbacks* callbacks,
143 const WebVector<long long>& web_index_ids,
144 const WebVector<WebIndexKeys>& web_index_keys) {
145 IndexedDBDispatcher* dispatcher =
146 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
119 dispatcher->RequestIDBDatabasePut(ipc_database_id_, 147 dispatcher->RequestIDBDatabasePut(ipc_database_id_,
120 transaction_id, 148 transaction_id,
121 object_store_id, 149 object_store_id,
122 value, 150 value,
151 web_blob_info,
123 IndexedDBKeyBuilder::Build(key), 152 IndexedDBKeyBuilder::Build(key),
124 put_mode, 153 put_mode,
125 callbacks, 154 callbacks,
126 web_index_ids, 155 web_index_ids,
127 web_index_keys); 156 web_index_keys);
128 } 157 }
129 158
130 void WebIDBDatabaseImpl::setIndexKeys( 159 void WebIDBDatabaseImpl::setIndexKeys(
131 long long transaction_id, 160 long long transaction_id,
132 long long object_store_id, 161 long long object_store_id,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 292
264 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { 293 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) {
265 DCHECK(uuids.size()); 294 DCHECK(uuids.size());
266 std::vector<std::string> param(uuids.size()); 295 std::vector<std::string> param(uuids.size());
267 for (size_t i = 0; i < uuids.size(); ++i) 296 for (size_t i = 0; i < uuids.size(); ++i)
268 param[i] = uuids[i].latin1().data(); 297 param[i] = uuids[i].latin1().data();
269 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); 298 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param));
270 } 299 }
271 300
272 } // namespace content 301 } // namespace content
OLDNEW
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698