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