OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CHANGE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CHANGE_HANDLER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "content/common/content_export.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class IndexedDBConnection; |
| 18 class IndexedDBDatabaseError; |
| 19 class IndexedDBObserverChanges; |
| 20 |
| 21 // A utility class to handle certain change events and notify recipients of |
| 22 // those changes. |
| 23 class CONTENT_EXPORT IndexedDBChangeHandler |
| 24 : public base::RefCounted<IndexedDBChangeHandler> { |
| 25 public: |
| 26 virtual void OnForcedClose() = 0; |
| 27 virtual void OnVersionChange(int64_t old_version, int64_t new_version) = 0; |
| 28 |
| 29 virtual void OnAbort(int64_t transaction_id, |
| 30 const IndexedDBDatabaseError& error) = 0; |
| 31 virtual void OnComplete(int64_t transaction_id) = 0; |
| 32 virtual void OnDatabaseChange( |
| 33 int32_t ipc_database_id, |
| 34 std::unique_ptr<IndexedDBObserverChanges> changes) = 0; |
| 35 |
| 36 virtual void SetConnection(base::WeakPtr<IndexedDBConnection> connection) = 0; |
| 37 |
| 38 protected: |
| 39 IndexedDBChangeHandler() {} |
| 40 virtual ~IndexedDBChangeHandler() {} |
| 41 |
| 42 private: |
| 43 friend class base::RefCounted<IndexedDBChangeHandler>; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(IndexedDBChangeHandler); |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CHANGE_HANDLER_H_ |
OLD | NEW |