| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef IDBDatabaseCallbacks_h | 26 #ifndef IDBDatabaseCallbacks_h |
| 27 #define IDBDatabaseCallbacks_h | 27 #define IDBDatabaseCallbacks_h |
| 28 | 28 |
| 29 #include "modules/ModulesExport.h" | 29 #include "modules/ModulesExport.h" |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "public/platform/WebVector.h" |
| 31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 32 | 33 |
| 34 #include <unordered_map> |
| 35 |
| 33 namespace blink { | 36 namespace blink { |
| 34 | 37 |
| 35 class DOMException; | 38 class DOMException; |
| 36 class IDBDatabase; | 39 class IDBDatabase; |
| 37 class WebIDBDatabaseCallbacks; | 40 class WebIDBDatabaseCallbacks; |
| 41 struct WebIDBObservation; |
| 38 | 42 |
| 39 class MODULES_EXPORT IDBDatabaseCallbacks | 43 class MODULES_EXPORT IDBDatabaseCallbacks |
| 40 : public GarbageCollectedFinalized<IDBDatabaseCallbacks> { | 44 : public GarbageCollectedFinalized<IDBDatabaseCallbacks> { |
| 41 public: | 45 public: |
| 42 static IDBDatabaseCallbacks* create(); | 46 static IDBDatabaseCallbacks* create(); |
| 43 virtual ~IDBDatabaseCallbacks(); | 47 virtual ~IDBDatabaseCallbacks(); |
| 44 DECLARE_TRACE(); | 48 DECLARE_TRACE(); |
| 45 | 49 |
| 46 // IDBDatabaseCallbacks | 50 // IDBDatabaseCallbacks |
| 47 virtual void onForcedClose(); | 51 virtual void onForcedClose(); |
| 48 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); | 52 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); |
| 49 | 53 |
| 50 virtual void onAbort(int64_t transactionId, DOMException*); | 54 virtual void onAbort(int64_t transactionId, DOMException*); |
| 51 virtual void onComplete(int64_t transactionId); | 55 virtual void onComplete(int64_t transactionId); |
| 56 virtual void onChanges( |
| 57 const std::unordered_map<int32_t, std::vector<int32_t>>& |
| 58 observation_index_map, |
| 59 const WebVector<WebIDBObservation>& observations); |
| 52 | 60 |
| 53 void connect(IDBDatabase*); | 61 void connect(IDBDatabase*); |
| 54 | 62 |
| 55 // Returns a new WebIDBDatabaseCallbacks for this object. Must only be | 63 // Returns a new WebIDBDatabaseCallbacks for this object. Must only be |
| 56 // called once. | 64 // called once. |
| 57 std::unique_ptr<WebIDBDatabaseCallbacks> createWebCallbacks(); | 65 std::unique_ptr<WebIDBDatabaseCallbacks> createWebCallbacks(); |
| 58 void detachWebCallbacks(); | 66 void detachWebCallbacks(); |
| 59 void webCallbacksDestroyed(); | 67 void webCallbacksDestroyed(); |
| 60 | 68 |
| 61 protected: | 69 protected: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 WeakMember<IDBDatabase> m_database; | 81 WeakMember<IDBDatabase> m_database; |
| 74 | 82 |
| 75 // Pointer back to the WebIDBDatabaseCallbacks that holds a persistent | 83 // Pointer back to the WebIDBDatabaseCallbacks that holds a persistent |
| 76 // reference to this object. | 84 // reference to this object. |
| 77 WebIDBDatabaseCallbacks* m_webCallbacks = nullptr; | 85 WebIDBDatabaseCallbacks* m_webCallbacks = nullptr; |
| 78 }; | 86 }; |
| 79 | 87 |
| 80 } // namespace blink | 88 } // namespace blink |
| 81 | 89 |
| 82 #endif // IDBDatabaseCallbacks_h | 90 #endif // IDBDatabaseCallbacks_h |
| OLD | NEW |