OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 16 matching lines...) Expand all Loading... | |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef TextTrackCue_h | 32 #ifndef TextTrackCue_h |
33 #define TextTrackCue_h | 33 #define TextTrackCue_h |
34 | 34 |
35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
36 #include "core/html/HTMLDivElement.h" | 36 #include "core/html/HTMLDivElement.h" |
37 #include "platform/heap/Handle.h" | |
37 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class ExceptionState; | 42 class ExceptionState; |
42 | 43 |
43 class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInli neData { | 44 class TextTrackCue : public RefCountedWillBeRefCountedGarbageCollected<TextTrack Cue>, public EventTargetWithInlineData { |
44 REFCOUNTED_EVENT_TARGET(TextTrackCue); | 45 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<T extTrackCue>); |
45 public: | 46 public: |
46 static bool isInfiniteOrNonNumber(double value, ExceptionState&); | 47 static bool isInfiniteOrNonNumber(double value, ExceptionState&); |
47 | 48 |
48 static const AtomicString& cueShadowPseudoId() | 49 static const AtomicString& cueShadowPseudoId() |
49 { | 50 { |
50 DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::Const ructFromLiteral)); | 51 DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::Const ructFromLiteral)); |
51 return cue; | 52 return cue; |
52 } | 53 } |
53 | 54 |
54 virtual ~TextTrackCue() { } | 55 virtual ~TextTrackCue() { } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 90 |
90 virtual const AtomicString& interfaceName() const OVERRIDE; | 91 virtual const AtomicString& interfaceName() const OVERRIDE; |
91 | 92 |
92 #ifndef NDEBUG | 93 #ifndef NDEBUG |
93 virtual String toString() const = 0; | 94 virtual String toString() const = 0; |
94 #endif | 95 #endif |
95 | 96 |
96 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); |
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); |
98 | 99 |
100 virtual void trace(Visitor*); | |
101 | |
99 protected: | 102 protected: |
100 TextTrackCue(double start, double end); | 103 TextTrackCue(double start, double end); |
101 | 104 |
102 void cueWillChange(); | 105 void cueWillChange(); |
103 virtual void cueDidChange(); | 106 virtual void cueDidChange(); |
104 | 107 |
105 private: | 108 private: |
106 AtomicString m_id; | 109 AtomicString m_id; |
107 double m_startTime; | 110 double m_startTime; |
108 double m_endTime; | 111 double m_endTime; |
109 int m_cueIndex; | 112 int m_cueIndex; |
110 | 113 |
111 TextTrack* m_track; | 114 RawPtrWillBeMember<TextTrack> m_track; |
haraken
2014/04/23 01:51:45
Shouldn't this be a WeakMember? The TextTrackCue o
sof
2014/04/23 05:38:47
If you make it weak, the cue can loose reference t
haraken
2014/04/23 05:53:54
Yes, but isn't that expected? As far as I read the
Mads Ager (chromium)
2014/04/23 05:59:38
This should be a strong pointer. The pattern that
haraken
2014/04/23 06:21:26
Understand, that makes sense.
So this CL is going
sof
2014/04/23 07:36:48
Certainly; have expanded the description to (try t
Erik Corry
2014/04/23 08:15:21
It's not clear that any "wrong behaviour" ever hap
| |
112 | 115 |
113 bool m_isActive : 1; | 116 bool m_isActive : 1; |
114 bool m_pauseOnExit : 1; | 117 bool m_pauseOnExit : 1; |
115 }; | 118 }; |
116 | 119 |
117 } // namespace WebCore | 120 } // namespace WebCore |
118 | 121 |
119 #endif | 122 #endif |
OLD | NEW |