| 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_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_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/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class IndexedDBDatabaseError; | 13 class IndexedDBDatabaseError; |
| 14 class IndexedDBDispatcherHost; | 14 class IndexedDBDispatcherHost; |
| 15 | 15 |
| 16 class CONTENT_EXPORT IndexedDBDatabaseCallbacks | 16 class CONTENT_EXPORT IndexedDBDatabaseCallbacks |
| 17 : public base::RefCounted<IndexedDBDatabaseCallbacks> { | 17 : public base::RefCounted<IndexedDBDatabaseCallbacks> { |
| 18 public: | 18 public: |
| 19 static scoped_refptr<IndexedDBDatabaseCallbacks> Create( | 19 IndexedDBDatabaseCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
| 20 IndexedDBDispatcherHost* dispatcher_host, | 20 int ipc_thread_id, |
| 21 int ipc_thread_id, | 21 int ipc_database_callbacks_id); |
| 22 int ipc_database_callbacks_id) { | |
| 23 return make_scoped_refptr( | |
| 24 new IndexedDBDatabaseCallbacks( | |
| 25 dispatcher_host, ipc_thread_id, ipc_database_callbacks_id)); | |
| 26 } | |
| 27 | 22 |
| 28 virtual void OnForcedClose(); | 23 virtual void OnForcedClose(); |
| 29 virtual void OnVersionChange(int64 old_version, int64 new_version); | 24 virtual void OnVersionChange(int64 old_version, int64 new_version); |
| 30 | 25 |
| 31 virtual void OnAbort(int64 host_transaction_id, | 26 virtual void OnAbort(int64 host_transaction_id, |
| 32 const IndexedDBDatabaseError& error); | 27 const IndexedDBDatabaseError& error); |
| 33 virtual void OnComplete(int64 host_transaction_id); | 28 virtual void OnComplete(int64 host_transaction_id); |
| 34 | 29 |
| 35 protected: | 30 protected: |
| 36 IndexedDBDatabaseCallbacks( | |
| 37 IndexedDBDispatcherHost* dispatcher_host, | |
| 38 int ipc_thread_id, | |
| 39 int ipc_database_callbacks_id); | |
| 40 virtual ~IndexedDBDatabaseCallbacks(); | 31 virtual ~IndexedDBDatabaseCallbacks(); |
| 41 | 32 |
| 42 private: | 33 private: |
| 43 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; | 34 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; |
| 44 | 35 |
| 45 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 36 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; |
| 46 int ipc_thread_id_; | 37 int ipc_thread_id_; |
| 47 int ipc_database_callbacks_id_; | 38 int ipc_database_callbacks_id_; |
| 48 }; | 39 }; |
| 49 | 40 |
| 50 } // namespace content | 41 } // namespace content |
| 51 | 42 |
| 52 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ | 43 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ |
| OLD | NEW |