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

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

Issue 11791009: IPC implementation for create/delete ObjectStore/Index (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add HostTransactionId where appropriate Created 7 years, 11 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
« no previous file with comments | « content/common/indexed_db/proxy_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 (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_webidbdatabase_impl.h" 5 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/common/child_thread.h" 9 #include "content/common/child_thread.h"
10 #include "content/common/indexed_db/indexed_db_messages.h" 10 #include "content/common/indexed_db/indexed_db_messages.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return web_metadata; 92 return web_metadata;
93 } 93 }
94 94
95 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( 95 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore(
96 long long id, 96 long long id,
97 const WebKit::WebString& name, 97 const WebKit::WebString& name,
98 const WebKit::WebIDBKeyPath& key_path, 98 const WebKit::WebIDBKeyPath& key_path,
99 bool auto_increment, 99 bool auto_increment,
100 const WebKit::WebIDBTransaction& transaction, 100 const WebKit::WebIDBTransaction& transaction,
101 WebExceptionCode& ec) { 101 WebExceptionCode& ec) {
102 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params; 102 IndexedDBHostMsg_DatabaseCreateObjectStoreOld_Params params;
103 params.id = id; 103 params.id = id;
104 params.name = name; 104 params.name = name;
105 params.key_path = IndexedDBKeyPath(key_path); 105 params.key_path = IndexedDBKeyPath(key_path);
106 params.auto_increment = auto_increment; 106 params.auto_increment = auto_increment;
107 params.ipc_transaction_id = IndexedDBDispatcher::TransactionId(transaction); 107 params.ipc_transaction_id = IndexedDBDispatcher::TransactionId(transaction);
108 params.ipc_database_id = ipc_database_id_; 108 params.ipc_database_id = ipc_database_id_;
109 109
110 int object_store; 110 int object_store;
111 IndexedDBDispatcher::Send( 111 IndexedDBDispatcher::Send(
112 new IndexedDBHostMsg_DatabaseCreateObjectStore( 112 new IndexedDBHostMsg_DatabaseCreateObjectStoreOld(
113 params, &object_store, &ec)); 113 params, &object_store, &ec));
114 if (!object_store) 114 if (!object_store)
115 return NULL; 115 return NULL;
116 return new RendererWebIDBObjectStoreImpl(object_store); 116 return new RendererWebIDBObjectStoreImpl(object_store);
117 } 117 }
118 118
119 void RendererWebIDBDatabaseImpl::createObjectStore(
120 long long transaction_id,
121 long long object_store_id,
122 const WebKit::WebString& name,
123 const WebKit::WebIDBKeyPath& key_path,
124 bool auto_increment) {
125 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params;
126 params.ipc_database_id = ipc_database_id_;
127 params.transaction_id = transaction_id;
128 params.object_store_id = object_store_id;
129 params.name = name;
130 params.key_path = IndexedDBKeyPath(key_path);
131 params.auto_increment = auto_increment;
132
133 IndexedDBDispatcher::Send(
134 new IndexedDBHostMsg_DatabaseCreateObjectStore(params));
135 }
136
119 void RendererWebIDBDatabaseImpl::deleteObjectStore( 137 void RendererWebIDBDatabaseImpl::deleteObjectStore(
120 long long object_store_id, 138 long long object_store_id,
121 const WebIDBTransaction& transaction, 139 const WebIDBTransaction& transaction,
122 WebExceptionCode& ec) { 140 WebExceptionCode& ec) {
123 IndexedDBDispatcher::Send( 141 IndexedDBDispatcher::Send(
124 new IndexedDBHostMsg_DatabaseDeleteObjectStore( 142 new IndexedDBHostMsg_DatabaseDeleteObjectStoreOld(
125 ipc_database_id_, object_store_id, 143 ipc_database_id_, object_store_id,
126 IndexedDBDispatcher::TransactionId(transaction), &ec)); 144 IndexedDBDispatcher::TransactionId(transaction), &ec));
127 } 145 }
128 146
147 void RendererWebIDBDatabaseImpl::deleteObjectStore(
148 long long transaction_id,
149 long long object_store_id) {
150 IndexedDBDispatcher::Send(
151 new IndexedDBHostMsg_DatabaseDeleteObjectStore(
152 ipc_database_id_,
153 transaction_id,
154 object_store_id));
155 }
156
129 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::createTransaction( 157 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::createTransaction(
130 long long transaction_id, 158 long long transaction_id,
131 const WebVector<long long>& object_store_ids, 159 const WebVector<long long>& object_store_ids,
132 unsigned short mode) { 160 unsigned short mode) {
133 std::vector<int64> object_stores; 161 std::vector<int64> object_stores;
134 object_stores.reserve(object_store_ids.size()); 162 object_stores.reserve(object_store_ids.size());
135 for (unsigned int i = 0; i < object_store_ids.size(); ++i) 163 for (unsigned int i = 0; i < object_store_ids.size(); ++i)
136 object_stores.push_back(object_store_ids[i]); 164 object_stores.push_back(object_store_ids[i]);
137 165
138 int ipc_transaction_id; 166 int ipc_transaction_id;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void RendererWebIDBDatabaseImpl::clear( 294 void RendererWebIDBDatabaseImpl::clear(
267 long long transaction_id, 295 long long transaction_id,
268 long long object_store_id, 296 long long object_store_id,
269 WebIDBCallbacks* callbacks) { 297 WebIDBCallbacks* callbacks) {
270 IndexedDBDispatcher* dispatcher = 298 IndexedDBDispatcher* dispatcher =
271 IndexedDBDispatcher::ThreadSpecificInstance(); 299 IndexedDBDispatcher::ThreadSpecificInstance();
272 dispatcher->RequestIDBDatabaseClear( 300 dispatcher->RequestIDBDatabaseClear(
273 ipc_database_id_, 301 ipc_database_id_,
274 transaction_id, object_store_id, callbacks); 302 transaction_id, object_store_id, callbacks);
275 } 303 }
304
305 void RendererWebIDBDatabaseImpl::createIndex(
306 long long transaction_id,
307 long long object_store_id,
308 long long index_id,
309 const WebString& name,
310 const WebIDBKeyPath& key_path,
311 bool unique,
312 bool multi_entry)
313 {
314 IndexedDBHostMsg_DatabaseCreateIndex_Params params;
315 params.ipc_database_id = ipc_database_id_;
316 params.transaction_id = transaction_id;
317 params.object_store_id = object_store_id;
318 params.index_id = index_id;
319 params.name = name;
320 params.key_path = IndexedDBKeyPath(key_path);
321 params.unique = unique;
322 params.multi_entry = multi_entry;
323
324 IndexedDBDispatcher::Send(
325 new IndexedDBHostMsg_DatabaseCreateIndex(params));
326 }
327
328 void RendererWebIDBDatabaseImpl::deleteIndex(
329 long long transaction_id,
330 long long object_store_id,
331 long long index_id)
332 {
333 IndexedDBDispatcher::Send(
334 new IndexedDBHostMsg_DatabaseDeleteIndex(
335 ipc_database_id_,
336 transaction_id,
337 object_store_id, index_id));
338 }
276 } // namespace content 339 } // namespace content
OLDNEW
« no previous file with comments | « content/common/indexed_db/proxy_webidbdatabase_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698