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_webidbobjectstore_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" |
6 | 6 |
7 #include "content/common/indexed_db/indexed_db_messages.h" | 7 #include "content/common/indexed_db/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/common/indexed_db/indexed_db_dispatcher.h" | 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
10 #include "content/common/indexed_db/proxy_webidbindex_impl.h" | 10 #include "content/common/indexed_db/proxy_webidbindex_impl.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 using WebKit::WebExceptionCode; | 24 using WebKit::WebExceptionCode; |
25 using WebKit::WebFrame; | 25 using WebKit::WebFrame; |
26 using WebKit::WebIDBCallbacks; | 26 using WebKit::WebIDBCallbacks; |
27 using WebKit::WebIDBKeyPath; | 27 using WebKit::WebIDBKeyPath; |
28 using WebKit::WebIDBKeyRange; | 28 using WebKit::WebIDBKeyRange; |
29 using WebKit::WebIDBIndex; | 29 using WebKit::WebIDBIndex; |
30 using WebKit::WebIDBKey; | 30 using WebKit::WebIDBKey; |
31 using WebKit::WebIDBTransaction; | 31 using WebKit::WebIDBTransaction; |
32 using WebKit::WebSerializedScriptValue; | 32 using WebKit::WebSerializedScriptValue; |
33 using WebKit::WebString; | 33 using WebKit::WebString; |
34 using WebKit::WebVector; | |
34 | 35 |
35 RendererWebIDBObjectStoreImpl::RendererWebIDBObjectStoreImpl( | 36 RendererWebIDBObjectStoreImpl::RendererWebIDBObjectStoreImpl( |
36 int32 idb_object_store_id) | 37 int32 idb_object_store_id) |
37 : idb_object_store_id_(idb_object_store_id) { | 38 : idb_object_store_id_(idb_object_store_id) { |
38 } | 39 } |
39 | 40 |
40 RendererWebIDBObjectStoreImpl::~RendererWebIDBObjectStoreImpl() { | 41 RendererWebIDBObjectStoreImpl::~RendererWebIDBObjectStoreImpl() { |
41 // It's not possible for there to be pending callbacks that address this | 42 // It's not possible for there to be pending callbacks that address this |
42 // object since inside WebKit, they hold a reference to the object wich owns | 43 // object since inside WebKit, they hold a reference to the object wich owns |
43 // this object. But, if that ever changed, then we'd need to invalidate | 44 // this object. But, if that ever changed, then we'd need to invalidate |
(...skipping 16 matching lines...) Expand all Loading... | |
60 | 61 |
61 void RendererWebIDBObjectStoreImpl::put( | 62 void RendererWebIDBObjectStoreImpl::put( |
62 const WebSerializedScriptValue& value, | 63 const WebSerializedScriptValue& value, |
63 const WebIDBKey& key, | 64 const WebIDBKey& key, |
64 PutMode put_mode, | 65 PutMode put_mode, |
65 WebIDBCallbacks* callbacks, | 66 WebIDBCallbacks* callbacks, |
66 const WebIDBTransaction& transaction, | 67 const WebIDBTransaction& transaction, |
67 WebExceptionCode& ec) { | 68 WebExceptionCode& ec) { |
68 IndexedDBDispatcher* dispatcher = | 69 IndexedDBDispatcher* dispatcher = |
69 IndexedDBDispatcher::ThreadSpecificInstance(); | 70 IndexedDBDispatcher::ThreadSpecificInstance(); |
71 WebVector<WebString> emptyIndexNames; | |
72 WebVector<WebVector<WebIDBKey> > emptyIndexKeys; | |
73 dispatcher->RequestIDBObjectStorePut( | |
74 SerializedScriptValue(value), content::IndexedDBKey(key), | |
jsbell
2012/07/10 17:46:54
Add a using content::IndexedDBKey; declaration nea
alecflett
2012/07/10 21:19:07
Done.
| |
75 put_mode, callbacks, idb_object_store_id_, transaction, | |
76 emptyIndexNames, emptyIndexKeys, &ec); | |
77 } | |
78 | |
79 void RendererWebIDBObjectStoreImpl::putWithIndexKeys( | |
80 const WebSerializedScriptValue& value, | |
81 const WebIDBKey& key, | |
82 PutMode put_mode, | |
83 WebIDBCallbacks* callbacks, | |
84 const WebIDBTransaction& transaction, | |
85 const WebVector<WebString>& indexNames, | |
86 const WebVector<WebVector<WebIDBKey> >& indexKeys, | |
87 WebExceptionCode& ec) { | |
88 IndexedDBDispatcher* dispatcher = | |
89 IndexedDBDispatcher::ThreadSpecificInstance(); | |
70 dispatcher->RequestIDBObjectStorePut( | 90 dispatcher->RequestIDBObjectStorePut( |
71 SerializedScriptValue(value), content::IndexedDBKey(key), | 91 SerializedScriptValue(value), content::IndexedDBKey(key), |
jsbell
2012/07/10 17:46:54
and here
alecflett
2012/07/10 21:19:07
Done.
| |
72 put_mode, callbacks, idb_object_store_id_, transaction, &ec); | 92 put_mode, callbacks, idb_object_store_id_, transaction, |
93 indexNames, indexKeys, &ec); | |
73 } | 94 } |
74 | 95 |
75 void RendererWebIDBObjectStoreImpl::deleteFunction( | 96 void RendererWebIDBObjectStoreImpl::deleteFunction( |
76 const WebIDBKeyRange& key_range, | 97 const WebIDBKeyRange& key_range, |
77 WebIDBCallbacks* callbacks, | 98 WebIDBCallbacks* callbacks, |
78 const WebIDBTransaction& transaction, | 99 const WebIDBTransaction& transaction, |
79 WebExceptionCode& ec) { | 100 WebExceptionCode& ec) { |
80 IndexedDBDispatcher* dispatcher = | 101 IndexedDBDispatcher* dispatcher = |
81 IndexedDBDispatcher::ThreadSpecificInstance(); | 102 IndexedDBDispatcher::ThreadSpecificInstance(); |
82 dispatcher->RequestIDBObjectStoreDelete( | 103 dispatcher->RequestIDBObjectStoreDelete( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 const WebIDBKeyRange& idb_key_range, | 176 const WebIDBKeyRange& idb_key_range, |
156 WebIDBCallbacks* callbacks, | 177 WebIDBCallbacks* callbacks, |
157 const WebIDBTransaction& transaction, | 178 const WebIDBTransaction& transaction, |
158 WebExceptionCode& ec) { | 179 WebExceptionCode& ec) { |
159 IndexedDBDispatcher* dispatcher = | 180 IndexedDBDispatcher* dispatcher = |
160 IndexedDBDispatcher::ThreadSpecificInstance(); | 181 IndexedDBDispatcher::ThreadSpecificInstance(); |
161 dispatcher->RequestIDBObjectStoreCount( | 182 dispatcher->RequestIDBObjectStoreCount( |
162 idb_key_range, callbacks, idb_object_store_id_, | 183 idb_key_range, callbacks, idb_object_store_id_, |
163 transaction, &ec); | 184 transaction, &ec); |
164 } | 185 } |
OLD | NEW |