Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: Source/core/html/track/TextTrackList.h

Issue 244493002: Oilpan: add transition types to track interface objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reinstitute explicit clearing of owners in the non-oilpan case Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef TextTrackList_h 26 #ifndef TextTrackList_h
27 #define TextTrackList_h 27 #define TextTrackList_h
28 28
29 #include "bindings/v8/ScriptWrappable.h" 29 #include "bindings/v8/ScriptWrappable.h"
30 #include "core/events/EventListener.h" 30 #include "core/events/EventListener.h"
31 #include "core/events/EventTarget.h" 31 #include "core/events/EventTarget.h"
32 #include "core/html/HTMLMediaElement.h" 32 #include "core/html/HTMLMediaElement.h"
33 #include "platform/Timer.h" 33 #include "platform/Timer.h"
34 #include "platform/heap/Handle.h"
34 #include "wtf/PassRefPtr.h" 35 #include "wtf/PassRefPtr.h"
35 #include "wtf/RefCounted.h" 36 #include "wtf/RefCounted.h"
36 #include "wtf/Vector.h" 37 #include "wtf/Vector.h"
37 38
38 namespace WebCore { 39 namespace WebCore {
39 40
40 class GenericEventQueue; 41 class GenericEventQueue;
41 class TextTrack; 42 class TextTrack;
42 43
43 class TextTrackList FINAL : public RefCounted<TextTrackList>, public ScriptWrapp able, public EventTargetWithInlineData { 44 class TextTrackList FINAL : public RefCountedWillBeRefCountedGarbageCollected<Te xtTrackList>, public ScriptWrappable, public EventTargetWithInlineData {
44 REFCOUNTED_EVENT_TARGET(TextTrackList); 45 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<T extTrackList>);
45 public: 46 public:
46 static PassRefPtr<TextTrackList> create(HTMLMediaElement* owner) 47 static PassRefPtrWillBeRawPtr<TextTrackList> create(HTMLMediaElement* owner)
47 { 48 {
48 return adoptRef(new TextTrackList(owner)); 49 return adoptRefWillBeRefCountedGarbageCollected(new TextTrackList(owner) );
49 } 50 }
50 virtual ~TextTrackList(); 51 virtual ~TextTrackList();
51 52
52 unsigned length() const; 53 unsigned length() const;
53 int getTrackIndex(TextTrack*); 54 int getTrackIndex(TextTrack*);
54 int getTrackIndexRelativeToRenderedTracks(TextTrack*); 55 int getTrackIndexRelativeToRenderedTracks(TextTrack*);
55 bool contains(TextTrack*) const; 56 bool contains(TextTrack*) const;
56 57
57 TextTrack* item(unsigned index); 58 TextTrack* item(unsigned index);
58 TextTrack* getTrackById(const AtomicString& id); 59 TextTrack* getTrackById(const AtomicString& id);
59 void append(PassRefPtr<TextTrack>); 60 void append(PassRefPtrWillBeRawPtr<TextTrack>);
60 void remove(TextTrack*); 61 void remove(TextTrack*);
61 62
62 // EventTarget 63 // EventTarget
63 virtual const AtomicString& interfaceName() const OVERRIDE; 64 virtual const AtomicString& interfaceName() const OVERRIDE;
64 virtual ExecutionContext* executionContext() const OVERRIDE; 65 virtual ExecutionContext* executionContext() const OVERRIDE;
65 66
66 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
67 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
69 70
71 #if !ENABLE(OILPAN)
70 void clearOwner(); 72 void clearOwner();
73 #endif
71 HTMLMediaElement* owner() const; 74 HTMLMediaElement* owner() const;
72 75
73 void scheduleChangeEvent(); 76 void scheduleChangeEvent();
74 void removeAllInbandTracks(); 77 void removeAllInbandTracks();
75 78
79 void trace(Visitor*);
80
76 private: 81 private:
77 explicit TextTrackList(HTMLMediaElement*); 82 explicit TextTrackList(HTMLMediaElement*);
78 83
79 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack> ); 84 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPt r<TextTrack>);
80 85
81 void scheduleAddTrackEvent(PassRefPtr<TextTrack>); 86 void scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>);
82 void scheduleRemoveTrackEvent(PassRefPtr<TextTrack>); 87 void scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>);
83 88
84 void invalidateTrackIndexesAfterTrack(TextTrack*); 89 void invalidateTrackIndexesAfterTrack(TextTrack*);
85 90
86 HTMLMediaElement* m_owner; 91 RawPtrWillBeMember<HTMLMediaElement> m_owner;
haraken 2014/04/23 01:51:45 Shouldn't this be a WeakMember?
sof 2014/04/23 05:38:47 No. See https://code.google.com/p/chromium/issue
haraken 2014/04/23 05:53:54 Ah, makes sense. This is implemented as a weak mem
sof 2014/04/23 07:36:48 We need to address that crasher in some way for th
haraken 2014/04/23 07:45:26 Probably you can add the test to this CL, and then
87 92
88 OwnPtr<GenericEventQueue> m_asyncEventQueue; 93 OwnPtr<GenericEventQueue> m_asyncEventQueue;
89 94
90 Vector<RefPtr<TextTrack> > m_addTrackTracks; 95 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_addTrackTracks;
91 Vector<RefPtr<TextTrack> > m_elementTracks; 96 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_elementTracks;
92 Vector<RefPtr<TextTrack> > m_inbandTracks; 97 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_inbandTracks;
93 }; 98 };
94 99
95 } // namespace WebCore 100 } // namespace WebCore
96 101
97 #endif 102 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698