| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 14 #include "content/public/browser/browser_thread.h" |
| 13 | 15 |
| 14 namespace content { | 16 namespace content { |
| 15 class IndexedDBDatabaseError; | 17 class IndexedDBDatabaseError; |
| 16 class IndexedDBDispatcherHost; | 18 class IndexedDBDispatcherHost; |
| 17 class IndexedDBObserverChanges; | 19 class IndexedDBObserverChanges; |
| 18 | 20 |
| 19 class CONTENT_EXPORT IndexedDBDatabaseCallbacks | 21 class CONTENT_EXPORT IndexedDBDatabaseCallbacks |
| 20 : public base::RefCounted<IndexedDBDatabaseCallbacks> { | 22 : public base::RefCounted<IndexedDBDatabaseCallbacks> { |
| 21 public: | 23 public: |
| 22 IndexedDBDatabaseCallbacks(IndexedDBDispatcherHost* dispatcher_host, | 24 IndexedDBDatabaseCallbacks( |
| 23 int ipc_thread_id, | 25 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, |
| 24 int ipc_database_callbacks_id); | 26 int32_t ipc_thread_id, |
| 27 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info); |
| 25 | 28 |
| 26 virtual void OnForcedClose(); | 29 virtual void OnForcedClose(); |
| 27 virtual void OnVersionChange(int64_t old_version, int64_t new_version); | 30 virtual void OnVersionChange(int64_t old_version, int64_t new_version); |
| 28 | 31 |
| 29 virtual void OnAbort(int64_t host_transaction_id, | 32 virtual void OnAbort(int64_t host_transaction_id, |
| 30 const IndexedDBDatabaseError& error); | 33 const IndexedDBDatabaseError& error); |
| 31 virtual void OnComplete(int64_t host_transaction_id); | 34 virtual void OnComplete(int64_t host_transaction_id); |
| 32 virtual void OnDatabaseChange( | 35 virtual void OnDatabaseChange( |
| 33 int32_t ipc_database_id, | 36 int32_t ipc_database_id, |
| 34 std::unique_ptr<IndexedDBObserverChanges> changes); | 37 std::unique_ptr<IndexedDBObserverChanges> changes); |
| 35 | 38 |
| 36 protected: | 39 protected: |
| 37 virtual ~IndexedDBDatabaseCallbacks(); | 40 virtual ~IndexedDBDatabaseCallbacks(); |
| 38 | 41 |
| 39 private: | 42 private: |
| 40 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; | 43 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; |
| 41 | 44 |
| 45 class IOThreadHelper; |
| 46 |
| 42 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 47 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; |
| 43 int ipc_thread_id_; | 48 int32_t ipc_thread_id_; |
| 44 int ipc_database_callbacks_id_; | 49 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; |
| 45 | 50 |
| 46 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks); | 51 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks); |
| 47 }; | 52 }; |
| 48 | 53 |
| 49 } // namespace content | 54 } // namespace content |
| 50 | 55 |
| 51 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ | 56 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ |
| OLD | NEW |