OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 IndexedDBDispatcher::ThreadSpecificInstance(); |
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 IndexedDBDispatcher::ThreadSpecificInstance(); |
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 IndexedDBDispatcher::ThreadSpecificInstance(); |
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 IndexedDBDispatcher::ThreadSpecificInstance(); |
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 bool multi_entry, | 122 bool multi_entry, |
123 const WebIDBTransaction& transaction, | 123 const WebIDBTransaction& transaction, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 idb_object_store_id_, name, | 159 idb_object_store_id_, name, |
160 IndexedDBDispatcher::TransactionId(transaction), &ec)); | 160 IndexedDBDispatcher::TransactionId(transaction), &ec)); |
161 } | 161 } |
162 | 162 |
163 void RendererWebIDBObjectStoreImpl::openCursor( | 163 void RendererWebIDBObjectStoreImpl::openCursor( |
164 const WebIDBKeyRange& idb_key_range, | 164 const WebIDBKeyRange& idb_key_range, |
165 unsigned short direction, WebIDBCallbacks* callbacks, | 165 unsigned short direction, WebIDBCallbacks* callbacks, |
166 const WebIDBTransaction& transaction, | 166 const WebIDBTransaction& transaction, |
167 WebExceptionCode& ec) { | 167 WebExceptionCode& ec) { |
168 IndexedDBDispatcher* dispatcher = | 168 IndexedDBDispatcher* dispatcher = |
169 RenderThreadImpl::current()->indexed_db_dispatcher(); | 169 IndexedDBDispatcher::ThreadSpecificInstance(); |
170 dispatcher->RequestIDBObjectStoreOpenCursor( | 170 dispatcher->RequestIDBObjectStoreOpenCursor( |
171 idb_key_range, direction, callbacks, idb_object_store_id_, | 171 idb_key_range, direction, callbacks, idb_object_store_id_, |
172 transaction, &ec); | 172 transaction, &ec); |
173 } | 173 } |
OLD | NEW |