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 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 10 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h
" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h
" |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks { | 21 class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks { |
21 public: | 22 public: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const WebKit::WebSerializedScriptValue& value); | 100 const WebKit::WebSerializedScriptValue& value); |
100 virtual void onSuccess(const WebKit::WebIDBKey& key, | 101 virtual void onSuccess(const WebKit::WebIDBKey& key, |
101 const WebKit::WebIDBKey& primaryKey, | 102 const WebKit::WebIDBKey& primaryKey, |
102 const WebKit::WebSerializedScriptValue& value); | 103 const WebKit::WebSerializedScriptValue& value); |
103 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 104 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); |
104 virtual void onSuccessWithPrefetch( | 105 virtual void onSuccessWithPrefetch( |
105 const WebKit::WebVector<WebKit::WebIDBKey>& keys, | 106 const WebKit::WebVector<WebKit::WebIDBKey>& keys, |
106 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, | 107 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, |
107 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values); | 108 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values); |
108 | 109 |
| 110 virtual void onSuccess(WebKit::WebIDBCursor* idb_object, |
| 111 const WebKit::WebIDBKey& key, |
| 112 const WebKit::WebIDBKey& primaryKey, |
| 113 const WebKit::WebData& value); |
| 114 virtual void onSuccess(const WebKit::WebIDBKey& key, |
| 115 const WebKit::WebIDBKey& primaryKey, |
| 116 const WebKit::WebData& value); |
| 117 virtual void onSuccess(const WebKit::WebData& value); |
| 118 virtual void onSuccessWithPrefetch( |
| 119 const WebKit::WebVector<WebKit::WebIDBKey>& keys, |
| 120 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, |
| 121 const WebKit::WebVector<WebKit::WebData>& values); |
| 122 |
109 private: | 123 private: |
110 // The id of the cursor this callback concerns, or -1 if the cursor | 124 // The id of the cursor this callback concerns, or -1 if the cursor |
111 // does not exist yet. | 125 // does not exist yet. |
112 int32 ipc_cursor_id_; | 126 int32 ipc_cursor_id_; |
113 | 127 |
114 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 128 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
115 }; | 129 }; |
116 | 130 |
117 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium | 131 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium |
118 // implements. Thus we pass a const ___& version and thus we need this | 132 // implements. Thus we pass a const ___& version and thus we need this |
(...skipping 27 matching lines...) Expand all Loading... |
146 int32 ipc_response_id) | 160 int32 ipc_response_id) |
147 : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id, | 161 : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id, |
148 ipc_response_id) { } | 162 ipc_response_id) { } |
149 | 163 |
150 virtual void onSuccess(const WebKit::WebDOMStringList& value); | 164 virtual void onSuccess(const WebKit::WebDOMStringList& value); |
151 | 165 |
152 private: | 166 private: |
153 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 167 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
154 }; | 168 }; |
155 | 169 |
156 // WebSerializedScriptValue is implemented in WebKit as opposed to being an | 170 // WebData is implemented in WebKit as opposed to being an interface |
157 // interface Chromium implements. Thus we pass a const ___& version and thus | 171 // Chromium implements. Thus we pass a const ___& version and thus we |
158 // we need this specialization. | 172 // need this specialization. |
159 template <> | 173 template <> |
160 class IndexedDBCallbacks<WebKit::WebSerializedScriptValue> | 174 class IndexedDBCallbacks<WebKit::WebData> |
161 : public IndexedDBCallbacksBase { | 175 : public IndexedDBCallbacksBase { |
162 public: | 176 public: |
163 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | 177 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
164 int32 ipc_thread_id, | 178 int32 ipc_thread_id, |
165 int32 ipc_response_id) | 179 int32 ipc_response_id) |
166 : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id, | 180 : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id, |
167 ipc_response_id) { } | 181 ipc_response_id) { } |
168 | 182 |
169 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 183 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); |
170 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, | 184 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, |
171 const WebKit::WebIDBKey& key, | 185 const WebKit::WebIDBKey& key, |
172 const WebKit::WebIDBKeyPath& keyPath); | 186 const WebKit::WebIDBKeyPath& keyPath); |
| 187 virtual void onSuccess(const WebKit::WebData& value); |
| 188 virtual void onSuccess(const WebKit::WebData& value, |
| 189 const WebKit::WebIDBKey& key, |
| 190 const WebKit::WebIDBKeyPath& keyPath); |
173 virtual void onSuccess(long long value); | 191 virtual void onSuccess(long long value); |
174 virtual void onSuccess(); | 192 virtual void onSuccess(); |
175 virtual void onSuccess(const WebKit::WebIDBKey& value); | 193 virtual void onSuccess(const WebKit::WebIDBKey& value); |
176 | 194 |
177 private: | 195 private: |
178 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 196 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
179 }; | 197 }; |
180 | 198 |
181 } // namespace content | 199 } // namespace content |
182 | 200 |
183 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 201 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
OLD | NEW |