OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
15 #include "content/browser/indexed_db/indexed_db_database_error.h" | 16 #include "content/browser/indexed_db/indexed_db_database_error.h" |
16 #include "content/common/indexed_db/indexed_db_key.h" | 17 #include "content/common/indexed_db/indexed_db_key.h" |
17 #include "content/common/indexed_db/indexed_db_key_path.h" | 18 #include "content/common/indexed_db/indexed_db_key_path.h" |
18 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" | 19 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 class IndexedDBCallbacksBase; | 22 class IndexedDBCallbacksBase; |
22 class IndexedDBDatabaseCallbacksWrapper; | |
23 class IndexedDBCursor; | 23 class IndexedDBCursor; |
24 class IndexedDBDatabase; | 24 class IndexedDBDatabase; |
25 class WebIDBDatabaseImpl; | 25 class WebIDBDatabaseImpl; |
26 struct IndexedDBDatabaseMetadata; | 26 struct IndexedDBDatabaseMetadata; |
27 | 27 |
28 class CONTENT_EXPORT IndexedDBCallbacksWrapper | 28 class CONTENT_EXPORT IndexedDBCallbacksWrapper |
29 : public base::RefCounted<IndexedDBCallbacksWrapper> { | 29 : public base::RefCounted<IndexedDBCallbacksWrapper> { |
30 public: | 30 public: |
31 static scoped_refptr<IndexedDBCallbacksWrapper> Create( | 31 static scoped_refptr<IndexedDBCallbacksWrapper> Create( |
32 IndexedDBCallbacksBase* callbacks) { | 32 IndexedDBCallbacksBase* callbacks) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void OnBlocked(int64 existing_version); | 72 virtual void OnBlocked(int64 existing_version); |
73 // From IDBFactory.open() | 73 // From IDBFactory.open() |
74 virtual void OnUpgradeNeeded( | 74 virtual void OnUpgradeNeeded( |
75 int64 old_version, | 75 int64 old_version, |
76 scoped_refptr<IndexedDBDatabase> db, | 76 scoped_refptr<IndexedDBDatabase> db, |
77 const content::IndexedDBDatabaseMetadata& metadata, | 77 const content::IndexedDBDatabaseMetadata& metadata, |
78 WebKit::WebIDBCallbacks::DataLoss data_loss); | 78 WebKit::WebIDBCallbacks::DataLoss data_loss); |
79 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db, | 79 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db, |
80 const content::IndexedDBDatabaseMetadata& metadata); | 80 const content::IndexedDBDatabaseMetadata& metadata); |
81 virtual void SetDatabaseCallbacks( | 81 virtual void SetDatabaseCallbacks( |
82 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks); | 82 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks); |
83 | 83 |
84 protected: | 84 protected: |
85 virtual ~IndexedDBCallbacksWrapper(); | 85 virtual ~IndexedDBCallbacksWrapper(); |
86 explicit IndexedDBCallbacksWrapper(IndexedDBCallbacksBase* callbacks); | 86 explicit IndexedDBCallbacksWrapper(IndexedDBCallbacksBase* callbacks); |
87 | 87 |
88 private: | 88 private: |
89 friend class base::RefCounted<IndexedDBCallbacksWrapper>; | 89 friend class base::RefCounted<IndexedDBCallbacksWrapper>; |
90 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_; | 90 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_; |
91 scoped_ptr<IndexedDBCallbacksBase> callbacks_; | 91 scoped_ptr<IndexedDBCallbacksBase> callbacks_; |
92 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_; | 92 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks_; |
93 bool did_complete_; | 93 bool did_complete_; |
94 bool did_create_proxy_; | 94 bool did_create_proxy_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
98 | 98 |
99 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ | 99 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ |
OLD | NEW |