 Chromium Code Reviews
 Chromium Code Reviews Issue 244493002:
  Oilpan: add transition types to track interface objects.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 244493002:
  Oilpan: add transition types to track interface objects.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 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 Loading... | |
| 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(); | 
| 52 void dispose(); | |
| 51 | 53 | 
| 52 unsigned length() const; | 54 unsigned length() const; | 
| 53 int getTrackIndex(TextTrack*); | 55 int getTrackIndex(TextTrack*); | 
| 54 int getTrackIndexRelativeToRenderedTracks(TextTrack*); | 56 int getTrackIndexRelativeToRenderedTracks(TextTrack*); | 
| 55 bool contains(TextTrack*) const; | 57 bool contains(TextTrack*) const; | 
| 56 | 58 | 
| 57 TextTrack* item(unsigned index); | 59 TextTrack* item(unsigned index); | 
| 58 TextTrack* getTrackById(const AtomicString& id); | 60 TextTrack* getTrackById(const AtomicString& id); | 
| 59 void append(PassRefPtr<TextTrack>); | 61 void append(PassRefPtrWillBeRawPtr<TextTrack>); | 
| 60 void remove(TextTrack*); | 62 void remove(TextTrack*); | 
| 61 | 63 | 
| 62 // EventTarget | 64 // EventTarget | 
| 63 virtual const AtomicString& interfaceName() const OVERRIDE; | 65 virtual const AtomicString& interfaceName() const OVERRIDE; | 
| 64 virtual ExecutionContext* executionContext() const OVERRIDE; | 66 virtual ExecutionContext* executionContext() const OVERRIDE; | 
| 65 | 67 | 
| 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 
| 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 
| 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 
| 69 | 71 | 
| 70 void clearOwner(); | |
| 71 HTMLMediaElement* owner() const; | 72 HTMLMediaElement* owner() const; | 
| 72 | 73 | 
| 73 void scheduleChangeEvent(); | 74 void scheduleChangeEvent(); | 
| 74 void removeAllInbandTracks(); | 75 void removeAllInbandTracks(); | 
| 75 | 76 | 
| 77 void trace(Visitor*); | |
| 78 | |
| 76 private: | 79 private: | 
| 77 explicit TextTrackList(HTMLMediaElement*); | 80 explicit TextTrackList(HTMLMediaElement*); | 
| 78 | 81 | 
| 79 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack> ); | 82 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPt r<TextTrack>); | 
| 80 | 83 | 
| 81 void scheduleAddTrackEvent(PassRefPtr<TextTrack>); | 84 void scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); | 
| 82 void scheduleRemoveTrackEvent(PassRefPtr<TextTrack>); | 85 void scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); | 
| 83 | 86 | 
| 84 void invalidateTrackIndexesAfterTrack(TextTrack*); | 87 void invalidateTrackIndexesAfterTrack(TextTrack*); | 
| 85 | 88 | 
| 86 HTMLMediaElement* m_owner; | 89 HTMLMediaElement* m_owner; | 
| 
Mads Ager (chromium)
2014/04/22 10:33:25
Is there any reason to keep this a raw pointer? It
 
sof
2014/04/22 12:44:01
Yes, having a strong reference in that direction m
 | |
| 87 | 90 | 
| 88 OwnPtr<GenericEventQueue> m_asyncEventQueue; | 91 OwnPtr<GenericEventQueue> m_asyncEventQueue; | 
| 89 | 92 | 
| 90 Vector<RefPtr<TextTrack> > m_addTrackTracks; | 93 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_addTrackTracks; | 
| 91 Vector<RefPtr<TextTrack> > m_elementTracks; | 94 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_elementTracks; | 
| 92 Vector<RefPtr<TextTrack> > m_inbandTracks; | 95 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_inbandTracks; | 
| 93 }; | 96 }; | 
| 94 | 97 | 
| 95 } // namespace WebCore | 98 } // namespace WebCore | 
| 96 | 99 | 
| 97 #endif | 100 #endif | 
| OLD | NEW |