| 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_DATABASE_CALLBACKS_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_WRAPPER_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_WRAPPER_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 "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "content/browser/indexed_db/indexed_db_database_error.h" | 12 #include "content/browser/indexed_db/indexed_db_database_error.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "third_party/WebKit/public/platform/WebIDBDatabaseCallbacks.h" | |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 16 class IndexedDBDatabaseCallbacks; |
| 17 | 17 |
| 18 class CONTENT_EXPORT IndexedDBDatabaseCallbacksWrapper | 18 class CONTENT_EXPORT IndexedDBDatabaseCallbacksWrapper |
| 19 : public base::RefCounted<IndexedDBDatabaseCallbacksWrapper> { | 19 : public base::RefCounted<IndexedDBDatabaseCallbacksWrapper> { |
| 20 public: | 20 public: |
| 21 static scoped_refptr<IndexedDBDatabaseCallbacksWrapper> Create( | 21 static scoped_refptr<IndexedDBDatabaseCallbacksWrapper> Create( |
| 22 WebKit::WebIDBDatabaseCallbacks* callbacks) { | 22 IndexedDBDatabaseCallbacks* callbacks) { |
| 23 return make_scoped_refptr(new IndexedDBDatabaseCallbacksWrapper(callbacks)); | 23 return make_scoped_refptr(new IndexedDBDatabaseCallbacksWrapper(callbacks)); |
| 24 } | 24 } |
| 25 | 25 |
| 26 virtual void OnForcedClose(); | 26 virtual void OnForcedClose(); |
| 27 virtual void OnVersionChange(int64 old_version, int64 new_version); | 27 virtual void OnVersionChange(int64 old_version, int64 new_version); |
| 28 | 28 |
| 29 virtual void OnAbort(int64 transaction_id, | 29 virtual void OnAbort(int64 transaction_id, |
| 30 const IndexedDBDatabaseError& error); | 30 const IndexedDBDatabaseError& error); |
| 31 virtual void OnComplete(int64 transaction_id); | 31 virtual void OnComplete(int64 transaction_id); |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 explicit IndexedDBDatabaseCallbacksWrapper( | 34 explicit IndexedDBDatabaseCallbacksWrapper( |
| 35 WebKit::WebIDBDatabaseCallbacks* callbacks); | 35 IndexedDBDatabaseCallbacks* callbacks); |
| 36 virtual ~IndexedDBDatabaseCallbacksWrapper(); | 36 virtual ~IndexedDBDatabaseCallbacksWrapper(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend class base::RefCounted<IndexedDBDatabaseCallbacksWrapper>; | 39 friend class base::RefCounted<IndexedDBDatabaseCallbacksWrapper>; |
| 40 | 40 |
| 41 scoped_ptr<WebKit::WebIDBDatabaseCallbacks> callbacks_; | 41 scoped_ptr<IndexedDBDatabaseCallbacks> callbacks_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace content | 44 } // namespace content |
| 45 | 45 |
| 46 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_WRAPPER_H_ | 46 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_WRAPPER_H_ |
| OLD | NEW |