OLD | NEW |
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void RendererWebIDBDatabaseImpl::deleteObjectStore( | 119 void RendererWebIDBDatabaseImpl::deleteObjectStore( |
120 long long object_store_id, | 120 long long object_store_id, |
121 const WebIDBTransaction& transaction, | 121 const WebIDBTransaction& transaction, |
122 WebExceptionCode& ec) { | 122 WebExceptionCode& ec) { |
123 IndexedDBDispatcher::Send( | 123 IndexedDBDispatcher::Send( |
124 new IndexedDBHostMsg_DatabaseDeleteObjectStore( | 124 new IndexedDBHostMsg_DatabaseDeleteObjectStore( |
125 idb_database_id_, object_store_id, | 125 idb_database_id_, object_store_id, |
126 IndexedDBDispatcher::TransactionId(transaction), &ec)); | 126 IndexedDBDispatcher::TransactionId(transaction), &ec)); |
127 } | 127 } |
128 | 128 |
129 void RendererWebIDBDatabaseImpl::setVersion( | |
130 const WebString& version, | |
131 WebIDBCallbacks* callbacks, | |
132 WebExceptionCode& ec) { | |
133 IndexedDBDispatcher* dispatcher = | |
134 IndexedDBDispatcher::ThreadSpecificInstance(); | |
135 dispatcher->RequestIDBDatabaseSetVersion( | |
136 version, callbacks, idb_database_id_, &ec); | |
137 } | |
138 | |
139 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( | 129 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( |
140 const WebVector<long long>& object_store_ids, | 130 const WebVector<long long>& object_store_ids, |
141 unsigned short mode) { | 131 unsigned short mode) { |
142 std::vector<int64> object_stores; | 132 std::vector<int64> object_stores; |
143 object_stores.reserve(object_store_ids.size()); | 133 object_stores.reserve(object_store_ids.size()); |
144 for (unsigned int i = 0; i < object_store_ids.size(); ++i) | 134 for (unsigned int i = 0; i < object_store_ids.size(); ++i) |
145 object_stores.push_back(object_store_ids[i]); | 135 object_stores.push_back(object_store_ids[i]); |
146 | 136 |
147 int transaction_id; | 137 int transaction_id; |
148 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseTransaction( | 138 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseTransaction( |
149 WorkerTaskRunner::Instance()->CurrentWorkerId(), | 139 WorkerTaskRunner::Instance()->CurrentWorkerId(), |
150 idb_database_id_, object_stores, mode, &transaction_id)); | 140 idb_database_id_, object_stores, mode, &transaction_id)); |
151 if (!transaction_id) | 141 if (!transaction_id) |
152 return NULL; | 142 return NULL; |
153 return new RendererWebIDBTransactionImpl(transaction_id); | 143 return new RendererWebIDBTransactionImpl(transaction_id); |
154 } | 144 } |
155 | 145 |
156 void RendererWebIDBDatabaseImpl::close() { | 146 void RendererWebIDBDatabaseImpl::close() { |
157 IndexedDBDispatcher* dispatcher = | 147 IndexedDBDispatcher* dispatcher = |
158 IndexedDBDispatcher::ThreadSpecificInstance(); | 148 IndexedDBDispatcher::ThreadSpecificInstance(); |
159 dispatcher->RequestIDBDatabaseClose(idb_database_id_); | 149 dispatcher->RequestIDBDatabaseClose(idb_database_id_); |
160 } | 150 } |
161 | 151 |
162 } // namespace content | 152 } // namespace content |
OLD | NEW |