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, | |
jsbell
2013/02/20 23:52:08
While you're in the guts here... what do you think
alecflett
2013/02/21 00:14:16
Talked about this briefly - we'll tackle this if/w
| |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 const WebKit::WebIDBKey& key, | 185 const WebKit::WebIDBKey& key, |
172 const WebKit::WebIDBKeyPath& keyPath); | 186 const WebKit::WebIDBKeyPath& keyPath); |
173 virtual void onSuccess(long long value); | 187 virtual void onSuccess(long long value); |
174 virtual void onSuccess(); | 188 virtual void onSuccess(); |
175 virtual void onSuccess(const WebKit::WebIDBKey& value); | 189 virtual void onSuccess(const WebKit::WebIDBKey& value); |
176 | 190 |
177 private: | 191 private: |
178 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 192 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
179 }; | 193 }; |
180 | 194 |
195 // WebData is implemented in WebKit as opposed to being an interface | |
196 // Chromium implements. Thus we pass a const ___& version and thus we | |
197 // need this specialization. | |
198 template <> | |
199 class IndexedDBCallbacks<WebKit::WebData> | |
200 : public IndexedDBCallbacksBase { | |
201 public: | |
202 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | |
203 int32 ipc_thread_id, | |
204 int32 ipc_response_id) | |
205 : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id, | |
206 ipc_response_id) { } | |
207 | |
208 virtual void onSuccess(const WebKit::WebData& value); | |
209 virtual void onSuccess(const WebKit::WebData& value, | |
210 const WebKit::WebIDBKey& key, | |
211 const WebKit::WebIDBKeyPath& keyPath); | |
212 virtual void onSuccess(long long value); | |
213 virtual void onSuccess(); | |
214 virtual void onSuccess(const WebKit::WebIDBKey& value); | |
215 | |
216 private: | |
217 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | |
218 }; | |
219 | |
181 } // namespace content | 220 } // namespace content |
182 | 221 |
183 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 222 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
OLD | NEW |