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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 struct IDBVersionChangeEventInit : public EventInit { | 41 struct IDBVersionChangeEventInit : public EventInit { |
42 IDBVersionChangeEventInit(); | 42 IDBVersionChangeEventInit(); |
43 | 43 |
44 unsigned long long oldVersion; | 44 unsigned long long oldVersion; |
45 Nullable<unsigned long long> newVersion; | 45 Nullable<unsigned long long> newVersion; |
46 }; | 46 }; |
47 | 47 |
48 class IDBVersionChangeEvent FINAL : public Event { | 48 class IDBVersionChangeEvent FINAL : public Event { |
49 public: | 49 public: |
50 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create() | 50 static PassRefPtr<IDBVersionChangeEvent> create() |
51 { | 51 { |
52 return adoptRefWillBeRefCountedGarbageCollected(new IDBVersionChangeEven
t()); | 52 return adoptRef(new IDBVersionChangeEvent()); |
53 } | 53 } |
54 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri
ng& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>
& newVersion, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const
String& dataLossMessage = String()) | 54 static PassRefPtr<IDBVersionChangeEvent> create(const AtomicString& eventTyp
e, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion
, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const String& data
LossMessage = String()) |
55 { | 55 { |
56 return adoptRefWillBeRefCountedGarbageCollected(new IDBVersionChangeEven
t(eventType, oldVersion, newVersion, dataLoss, dataLossMessage)); | 56 return adoptRef(new IDBVersionChangeEvent(eventType, oldVersion, newVers
ion, dataLoss, dataLossMessage)); |
57 } | 57 } |
58 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri
ng& eventType, const IDBVersionChangeEventInit& initializer) | 58 static PassRefPtr<IDBVersionChangeEvent> create(const AtomicString& eventTyp
e, const IDBVersionChangeEventInit& initializer) |
59 { | 59 { |
60 return adoptRefWillBeRefCountedGarbageCollected(new IDBVersionChangeEven
t(eventType, initializer)); | 60 return adoptRef(new IDBVersionChangeEvent(eventType, initializer)); |
61 } | 61 } |
62 | 62 |
63 unsigned long long oldVersion() const { return m_oldVersion; } | 63 unsigned long long oldVersion() const { return m_oldVersion; } |
64 unsigned long long newVersion(bool& isNull) const; | 64 unsigned long long newVersion(bool& isNull) const; |
65 | 65 |
66 const AtomicString& dataLoss() const; | 66 const AtomicString& dataLoss() const; |
67 const String& dataLossMessage() const { return m_dataLossMessage; } | 67 const String& dataLossMessage() const { return m_dataLossMessage; } |
68 | 68 |
69 virtual const AtomicString& interfaceName() const OVERRIDE; | 69 virtual const AtomicString& interfaceName() const OVERRIDE; |
70 | 70 |
71 virtual void trace(Visitor*) OVERRIDE; | 71 virtual void trace(Visitor*) OVERRIDE; |
72 | 72 |
73 private: | 73 private: |
74 IDBVersionChangeEvent(); | 74 IDBVersionChangeEvent(); |
75 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV
ersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, c
onst String& dataLoss); | 75 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV
ersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, c
onst String& dataLoss); |
76 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE
ventInit&); | 76 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE
ventInit&); |
77 | 77 |
78 unsigned long long m_oldVersion; | 78 unsigned long long m_oldVersion; |
79 Nullable<unsigned long long> m_newVersion; | 79 Nullable<unsigned long long> m_newVersion; |
80 bool m_dataLoss; | 80 bool m_dataLoss; |
81 String m_dataLossMessage; | 81 String m_dataLossMessage; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace WebCore | 84 } // namespace WebCore |
85 | 85 |
86 #endif // IDBVersionChangeEvent_h | 86 #endif // IDBVersionChangeEvent_h |
OLD | NEW |