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/public/platform/WebIDBCallbacks.h" |
12 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | 13 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" |
13 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" | 14 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class WebIDBCursorImpl; | 18 class WebIDBCursorImpl; |
18 class WebIDBDatabaseImpl; | 19 class WebIDBDatabaseImpl; |
19 struct IndexedDBDatabaseMetadata; | 20 struct IndexedDBDatabaseMetadata; |
20 | 21 |
21 class IndexedDBCallbacksBase { | 22 class IndexedDBCallbacksBase { |
22 public: | 23 public: |
23 virtual ~IndexedDBCallbacksBase(); | 24 virtual ~IndexedDBCallbacksBase(); |
24 | 25 |
25 virtual void onError(const WebKit::WebIDBDatabaseError& error); | 26 virtual void onError(const WebKit::WebIDBDatabaseError& error); |
26 virtual void onBlocked(long long old_version); | 27 virtual void onBlocked(long long old_version); |
27 | 28 |
28 // implemented by subclasses, but need to be called later | 29 // implemented by subclasses, but need to be called later |
29 virtual void onSuccess(const std::vector<string16>& value); | 30 virtual void onSuccess(const std::vector<string16>& value); |
30 virtual void onSuccess(WebIDBDatabaseImpl* idb_object, | 31 virtual void onSuccess(WebIDBDatabaseImpl* idb_object, |
31 const IndexedDBDatabaseMetadata& metadata); | 32 const IndexedDBDatabaseMetadata& metadata); |
32 virtual void onUpgradeNeeded(long long old_version, | 33 virtual void onUpgradeNeeded(long long old_version, |
33 WebIDBDatabaseImpl* database, | 34 WebIDBDatabaseImpl* database, |
34 const IndexedDBDatabaseMetadata&); | 35 const IndexedDBDatabaseMetadata&, |
| 36 WebKit::WebIDBCallbacks::DataLoss data_loss); |
35 virtual void onSuccess(WebIDBCursorImpl* idb_object, | 37 virtual void onSuccess(WebIDBCursorImpl* idb_object, |
36 const IndexedDBKey& key, | 38 const IndexedDBKey& key, |
37 const IndexedDBKey& primaryKey, | 39 const IndexedDBKey& primaryKey, |
38 std::vector<char>* value); | 40 std::vector<char>* value); |
39 virtual void onSuccess(const IndexedDBKey& key, | 41 virtual void onSuccess(const IndexedDBKey& key, |
40 const IndexedDBKey& primaryKey, | 42 const IndexedDBKey& primaryKey, |
41 std::vector<char>* value); | 43 std::vector<char>* value); |
42 virtual void onSuccess(std::vector<char>* value); | 44 virtual void onSuccess(std::vector<char>* value); |
43 virtual void onSuccessWithPrefetch( | 45 virtual void onSuccessWithPrefetch( |
44 const std::vector<IndexedDBKey>& keys, | 46 const std::vector<IndexedDBKey>& keys, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 int32 ipc_thread_id, | 84 int32 ipc_thread_id, |
83 int32 ipc_callbacks_id, | 85 int32 ipc_callbacks_id, |
84 int32 ipc_database_callbacks_id, | 86 int32 ipc_database_callbacks_id, |
85 int64 host_transaction_id, | 87 int64 host_transaction_id, |
86 const GURL& origin_url); | 88 const GURL& origin_url); |
87 | 89 |
88 virtual void onSuccess(WebIDBDatabaseImpl* idb_object, | 90 virtual void onSuccess(WebIDBDatabaseImpl* idb_object, |
89 const IndexedDBDatabaseMetadata& metadata) OVERRIDE; | 91 const IndexedDBDatabaseMetadata& metadata) OVERRIDE; |
90 virtual void onUpgradeNeeded(long long old_version, | 92 virtual void onUpgradeNeeded(long long old_version, |
91 WebIDBDatabaseImpl* database, | 93 WebIDBDatabaseImpl* database, |
92 const IndexedDBDatabaseMetadata&) OVERRIDE; | 94 const IndexedDBDatabaseMetadata&, |
| 95 WebKit::WebIDBCallbacks::DataLoss data_loss) |
| 96 OVERRIDE; |
93 | 97 |
94 private: | 98 private: |
95 int64 host_transaction_id_; | 99 int64 host_transaction_id_; |
96 GURL origin_url_; | 100 GURL origin_url_; |
97 int32 ipc_database_id_; | 101 int32 ipc_database_id_; |
98 int32 ipc_database_callbacks_id_; | 102 int32 ipc_database_callbacks_id_; |
99 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacksDatabase); | 103 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacksDatabase); |
100 }; | 104 }; |
101 | 105 |
102 // WebIDBCursorImpl uses: | 106 // WebIDBCursorImpl uses: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 virtual void onSuccess(); | 201 virtual void onSuccess(); |
198 virtual void onSuccess(const IndexedDBKey& value); | 202 virtual void onSuccess(const IndexedDBKey& value); |
199 | 203 |
200 private: | 204 private: |
201 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 205 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
202 }; | 206 }; |
203 | 207 |
204 } // namespace content | 208 } // namespace content |
205 | 209 |
206 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 210 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
OLD | NEW |