OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/renderer_webidbobjectstore_impl.h" | 5 #include "content/renderer/renderer_webidbobjectstore_impl.h" |
6 | 6 |
7 #include "content/common/indexed_db_messages.h" | 7 #include "content/common/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/renderer/indexed_db_dispatcher.h" | 9 #include "content/renderer/indexed_db_dispatcher.h" |
10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 return web_result; | 69 return web_result; |
70 } | 70 } |
71 | 71 |
72 void RendererWebIDBObjectStoreImpl::get( | 72 void RendererWebIDBObjectStoreImpl::get( |
73 const WebIDBKey& key, | 73 const WebIDBKey& key, |
74 WebIDBCallbacks* callbacks, | 74 WebIDBCallbacks* callbacks, |
75 const WebIDBTransaction& transaction, | 75 const WebIDBTransaction& transaction, |
76 WebExceptionCode& ec) { | 76 WebExceptionCode& ec) { |
77 IndexedDBDispatcher* dispatcher = | 77 IndexedDBDispatcher* dispatcher = |
78 RenderThreadImpl::current()->indexed_db_dispatcher(); | 78 ChildThread::current()->indexed_db_dispatcher(); |
79 dispatcher->RequestIDBObjectStoreGet( | 79 dispatcher->RequestIDBObjectStoreGet( |
80 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); | 80 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); |
81 } | 81 } |
82 | 82 |
83 void RendererWebIDBObjectStoreImpl::put( | 83 void RendererWebIDBObjectStoreImpl::put( |
84 const WebSerializedScriptValue& value, | 84 const WebSerializedScriptValue& value, |
85 const WebIDBKey& key, | 85 const WebIDBKey& key, |
86 PutMode put_mode, | 86 PutMode put_mode, |
87 WebIDBCallbacks* callbacks, | 87 WebIDBCallbacks* callbacks, |
88 const WebIDBTransaction& transaction, | 88 const WebIDBTransaction& transaction, |
89 WebExceptionCode& ec) { | 89 WebExceptionCode& ec) { |
90 IndexedDBDispatcher* dispatcher = | 90 IndexedDBDispatcher* dispatcher = |
91 RenderThreadImpl::current()->indexed_db_dispatcher(); | 91 ChildThread::current()->indexed_db_dispatcher(); |
92 dispatcher->RequestIDBObjectStorePut( | 92 dispatcher->RequestIDBObjectStorePut( |
93 content::SerializedScriptValue(value), IndexedDBKey(key), put_mode, | 93 content::SerializedScriptValue(value), IndexedDBKey(key), put_mode, |
94 callbacks, idb_object_store_id_, transaction, &ec); | 94 callbacks, idb_object_store_id_, transaction, &ec); |
95 } | 95 } |
96 | 96 |
97 void RendererWebIDBObjectStoreImpl::deleteFunction( | 97 void RendererWebIDBObjectStoreImpl::deleteFunction( |
98 const WebIDBKey& key, | 98 const WebIDBKey& key, |
99 WebIDBCallbacks* callbacks, | 99 WebIDBCallbacks* callbacks, |
100 const WebIDBTransaction& transaction, | 100 const WebIDBTransaction& transaction, |
101 WebExceptionCode& ec) { | 101 WebExceptionCode& ec) { |
102 IndexedDBDispatcher* dispatcher = | 102 IndexedDBDispatcher* dispatcher = |
103 RenderThreadImpl::current()->indexed_db_dispatcher(); | 103 ChildThread::current()->indexed_db_dispatcher(); |
104 dispatcher->RequestIDBObjectStoreDelete( | 104 dispatcher->RequestIDBObjectStoreDelete( |
105 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); | 105 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); |
106 } | 106 } |
107 | 107 |
108 void RendererWebIDBObjectStoreImpl::clear( | 108 void RendererWebIDBObjectStoreImpl::clear( |
109 WebIDBCallbacks* callbacks, | 109 WebIDBCallbacks* callbacks, |
110 const WebIDBTransaction& transaction, | 110 const WebIDBTransaction& transaction, |
111 WebExceptionCode& ec) { | 111 WebExceptionCode& ec) { |
112 IndexedDBDispatcher* dispatcher = | 112 IndexedDBDispatcher* dispatcher = |
113 RenderThreadImpl::current()->indexed_db_dispatcher(); | 113 ChildThread::current()->indexed_db_dispatcher(); |
114 dispatcher->RequestIDBObjectStoreClear( | 114 dispatcher->RequestIDBObjectStoreClear( |
115 callbacks, idb_object_store_id_, transaction, &ec); | 115 callbacks, idb_object_store_id_, transaction, &ec); |
116 } | 116 } |
117 | 117 |
118 WebIDBIndex* RendererWebIDBObjectStoreImpl::createIndex( | 118 WebIDBIndex* RendererWebIDBObjectStoreImpl::createIndex( |
119 const WebString& name, | 119 const WebString& name, |
120 const WebString& key_path, | 120 const WebString& key_path, |
121 bool unique, | 121 bool unique, |
122 const WebIDBTransaction& transaction, | 122 const WebIDBTransaction& transaction, |
123 WebExceptionCode& ec) { | 123 WebExceptionCode& ec) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 idb_object_store_id_, name, | 157 idb_object_store_id_, name, |
158 IndexedDBDispatcher::TransactionId(transaction), &ec)); | 158 IndexedDBDispatcher::TransactionId(transaction), &ec)); |
159 } | 159 } |
160 | 160 |
161 void RendererWebIDBObjectStoreImpl::openCursor( | 161 void RendererWebIDBObjectStoreImpl::openCursor( |
162 const WebIDBKeyRange& idb_key_range, | 162 const WebIDBKeyRange& idb_key_range, |
163 unsigned short direction, WebIDBCallbacks* callbacks, | 163 unsigned short direction, WebIDBCallbacks* callbacks, |
164 const WebIDBTransaction& transaction, | 164 const WebIDBTransaction& transaction, |
165 WebExceptionCode& ec) { | 165 WebExceptionCode& ec) { |
166 IndexedDBDispatcher* dispatcher = | 166 IndexedDBDispatcher* dispatcher = |
167 RenderThreadImpl::current()->indexed_db_dispatcher(); | 167 ChildThread::current()->indexed_db_dispatcher(); |
168 dispatcher->RequestIDBObjectStoreOpenCursor( | 168 dispatcher->RequestIDBObjectStoreOpenCursor( |
169 idb_key_range, direction, callbacks, idb_object_store_id_, | 169 idb_key_range, direction, callbacks, idb_object_store_id_, |
170 transaction, &ec); | 170 transaction, &ec); |
171 } | 171 } |
OLD | NEW |