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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #ifndef IDBVersionChangeEvent_h | 26 #ifndef IDBVersionChangeEvent_h |
27 #define IDBVersionChangeEvent_h | 27 #define IDBVersionChangeEvent_h |
28 | 28 |
29 #include "bindings/core/v8/Nullable.h" | 29 #include "bindings/core/v8/Nullable.h" |
30 #include "bindings/core/v8/SerializedScriptValue.h" | 30 #include "bindings/core/v8/SerializedScriptValue.h" |
31 #include "modules/EventModules.h" | 31 #include "modules/EventModules.h" |
32 #include "modules/indexeddb/IDBAny.h" | 32 #include "modules/indexeddb/IDBAny.h" |
33 #include "modules/indexeddb/IDBRequest.h" | 33 #include "modules/indexeddb/IDBRequest.h" |
34 #include "modules/indexeddb/IDBVersionChangeEventInit.h" | 34 #include "modules/indexeddb/IDBVersionChangeEventInit.h" |
35 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | |
36 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
37 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
38 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
39 | 38 |
40 namespace blink { | 39 namespace blink { |
41 | 40 |
42 class IDBVersionChangeEvent final : public Event { | 41 class IDBVersionChangeEvent final : public Event { |
43 DEFINE_WRAPPERTYPEINFO(); | 42 DEFINE_WRAPPERTYPEINFO(); |
44 public: | 43 public: |
45 static IDBVersionChangeEvent* create() | 44 static IDBVersionChangeEvent* create() |
46 { | 45 { |
47 return new IDBVersionChangeEvent(); | 46 return new IDBVersionChangeEvent(); |
48 } | 47 } |
49 static IDBVersionChangeEvent* create(const AtomicString& eventType, unsigned
long long oldVersion, const Nullable<unsigned long long>& newVersion, WebIDBDat
aLoss dataLoss = WebIDBDataLossNone, const String& dataLossMessage = String()) | 48 static IDBVersionChangeEvent* create(const AtomicString& eventType, unsigned
long long oldVersion, const Nullable<unsigned long long>& newVersion, indexed_d
b::mojom::blink::DataLoss dataLoss = indexed_db::mojom::blink::DataLoss::None, c
onst String& dataLossMessage = String()) |
50 { | 49 { |
51 return new IDBVersionChangeEvent(eventType, oldVersion, newVersion, data
Loss, dataLossMessage); | 50 return new IDBVersionChangeEvent(eventType, oldVersion, newVersion, data
Loss, dataLossMessage); |
52 } | 51 } |
53 static IDBVersionChangeEvent* create(const AtomicString& eventType, const ID
BVersionChangeEventInit& initializer) | 52 static IDBVersionChangeEvent* create(const AtomicString& eventType, const ID
BVersionChangeEventInit& initializer) |
54 { | 53 { |
55 return new IDBVersionChangeEvent(eventType, initializer); | 54 return new IDBVersionChangeEvent(eventType, initializer); |
56 } | 55 } |
57 | 56 |
58 unsigned long long oldVersion() const { return m_oldVersion; } | 57 unsigned long long oldVersion() const { return m_oldVersion; } |
59 unsigned long long newVersion(bool& isNull) const; | 58 unsigned long long newVersion(bool& isNull) const; |
60 | 59 |
61 const AtomicString& dataLoss() const; | 60 const AtomicString& dataLoss() const; |
62 const String& dataLossMessage() const { return m_dataLossMessage; } | 61 const String& dataLossMessage() const { return m_dataLossMessage; } |
63 | 62 |
64 const AtomicString& interfaceName() const override; | 63 const AtomicString& interfaceName() const override; |
65 | 64 |
66 DECLARE_VIRTUAL_TRACE(); | 65 DECLARE_VIRTUAL_TRACE(); |
67 | 66 |
68 private: | 67 private: |
69 IDBVersionChangeEvent(); | 68 IDBVersionChangeEvent(); |
70 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV
ersion, const Nullable<unsigned long long>& newVersion, WebIDBDataLoss, const St
ring& dataLoss); | 69 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV
ersion, const Nullable<unsigned long long>& newVersion, indexed_db::mojom::blink
::DataLoss, const String& dataLoss); |
71 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE
ventInit&); | 70 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE
ventInit&); |
72 | 71 |
73 unsigned long long m_oldVersion; | 72 unsigned long long m_oldVersion; |
74 Nullable<unsigned long long> m_newVersion; | 73 Nullable<unsigned long long> m_newVersion; |
75 WebIDBDataLoss m_dataLoss; | 74 indexed_db::mojom::blink::DataLoss m_dataLoss; |
76 String m_dataLossMessage; | 75 String m_dataLossMessage; |
77 }; | 76 }; |
78 | 77 |
79 } // namespace blink | 78 } // namespace blink |
80 | 79 |
81 #endif // IDBVersionChangeEvent_h | 80 #endif // IDBVersionChangeEvent_h |
OLD | NEW |