| 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 * 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef LoadableTextTrack_h | 26 #ifndef LoadableTextTrack_h |
| 27 #define LoadableTextTrack_h | 27 #define LoadableTextTrack_h |
| 28 | 28 |
| 29 #include "core/html/track/TextTrack.h" | 29 #include "core/html/track/TextTrack.h" |
| 30 #include "core/loader/TextTrackLoader.h" | 30 #include "core/loader/TextTrackLoader.h" |
| 31 #include "platform/heap/Handle.h" |
| 31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 32 | 33 |
| 33 namespace WebCore { | 34 namespace WebCore { |
| 34 | 35 |
| 35 class HTMLTrackElement; | 36 class HTMLTrackElement; |
| 36 class LoadableTextTrack; | 37 class LoadableTextTrack; |
| 37 | 38 |
| 38 class LoadableTextTrack FINAL : public TextTrack, private TextTrackLoaderClient
{ | 39 class LoadableTextTrack FINAL : public TextTrack, private TextTrackLoaderClient
{ |
| 39 public: | 40 public: |
| 40 static PassRefPtr<LoadableTextTrack> create(HTMLTrackElement* track) | 41 static PassRefPtrWillBeRawPtr<LoadableTextTrack> create(HTMLTrackElement* tr
ack) |
| 41 { | 42 { |
| 42 return adoptRef(new LoadableTextTrack(track)); | 43 return adoptRefWillBeRefCountedGarbageCollected(new LoadableTextTrack(tr
ack)); |
| 43 } | 44 } |
| 44 virtual ~LoadableTextTrack(); | 45 virtual ~LoadableTextTrack(); |
| 45 | 46 |
| 46 void scheduleLoad(const KURL&); | 47 void scheduleLoad(const KURL&); |
| 47 | 48 |
| 48 // TextTrack method. | 49 // TextTrack method. |
| 49 virtual void setMode(const AtomicString&) OVERRIDE; | 50 virtual void setMode(const AtomicString&) OVERRIDE; |
| 50 | 51 |
| 51 size_t trackElementIndex(); | 52 size_t trackElementIndex(); |
| 52 HTMLTrackElement* trackElement() { return m_trackElement; } | 53 HTMLTrackElement* trackElement() { return m_trackElement; } |
| 54 #if !ENABLE(OILPAN) |
| 53 void clearTrackElement(); | 55 void clearTrackElement(); |
| 56 #endif |
| 54 | 57 |
| 55 virtual bool isDefault() const OVERRIDE { return m_isDefault; } | 58 virtual bool isDefault() const OVERRIDE { return m_isDefault; } |
| 56 virtual void setIsDefault(bool isDefault) OVERRIDE { m_isDefault = isDefaul
t; } | 59 virtual void setIsDefault(bool isDefault) OVERRIDE { m_isDefault = isDefaul
t; } |
| 57 | 60 |
| 61 virtual void trace(Visitor*) OVERRIDE; |
| 62 |
| 58 private: | 63 private: |
| 59 // TextTrackLoaderClient | 64 // TextTrackLoaderClient |
| 60 virtual void newCuesAvailable(TextTrackLoader*) OVERRIDE; | 65 virtual void newCuesAvailable(TextTrackLoader*) OVERRIDE; |
| 61 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) OVERR
IDE; | 66 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) OVERR
IDE; |
| 62 virtual void newRegionsAvailable(TextTrackLoader*) OVERRIDE; | 67 virtual void newRegionsAvailable(TextTrackLoader*) OVERRIDE; |
| 63 | 68 |
| 64 LoadableTextTrack(HTMLTrackElement*); | 69 LoadableTextTrack(HTMLTrackElement*); |
| 65 | 70 |
| 66 void loadTimerFired(Timer<LoadableTextTrack>*); | 71 void loadTimerFired(Timer<LoadableTextTrack>*); |
| 67 | 72 |
| 68 HTMLTrackElement* m_trackElement; | 73 // FIXME: Oilpan: This should be a strong pointer once Member pointers |
| 74 // into the Node hierarchy can be used. |
| 75 RawPtrWillBeWeakMember<HTMLTrackElement> m_trackElement; |
| 69 Timer<LoadableTextTrack> m_loadTimer; | 76 Timer<LoadableTextTrack> m_loadTimer; |
| 70 OwnPtr<TextTrackLoader> m_loader; | 77 OwnPtrWillBeMember<TextTrackLoader> m_loader; |
| 71 KURL m_url; | 78 KURL m_url; |
| 72 bool m_isDefault; | 79 bool m_isDefault; |
| 73 }; | 80 }; |
| 74 } // namespace WebCore | 81 } // namespace WebCore |
| 75 | 82 |
| 76 #endif | 83 #endif |
| OLD | NEW |