Chromium Code Reviews| 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; } |
| 53 void clearTrackElement(); | 54 void clearTrackElement(); |
| 54 | 55 |
| 55 virtual bool isDefault() const OVERRIDE { return m_isDefault; } | 56 virtual bool isDefault() const OVERRIDE { return m_isDefault; } |
| 56 virtual void setIsDefault(bool isDefault) OVERRIDE { m_isDefault = isDefaul t; } | 57 virtual void setIsDefault(bool isDefault) OVERRIDE { m_isDefault = isDefaul t; } |
| 57 | 58 |
| 59 virtual void trace(Visitor*) OVERRIDE; | |
| 60 | |
| 58 private: | 61 private: |
| 59 // TextTrackLoaderClient | 62 // TextTrackLoaderClient |
| 60 virtual void newCuesAvailable(TextTrackLoader*) OVERRIDE; | 63 virtual void newCuesAvailable(TextTrackLoader*) OVERRIDE; |
| 61 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) OVERR IDE; | 64 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) OVERR IDE; |
| 62 virtual void newRegionsAvailable(TextTrackLoader*) OVERRIDE; | 65 virtual void newRegionsAvailable(TextTrackLoader*) OVERRIDE; |
| 63 | 66 |
| 64 LoadableTextTrack(HTMLTrackElement*); | 67 LoadableTextTrack(HTMLTrackElement*); |
| 65 | 68 |
| 66 void loadTimerFired(Timer<LoadableTextTrack>*); | 69 void loadTimerFired(Timer<LoadableTextTrack>*); |
| 67 | 70 |
| 68 HTMLTrackElement* m_trackElement; | 71 HTMLTrackElement* m_trackElement; |
|
haraken
2014/04/22 02:37:47
This raw pointer looks safe because it's cleared i
| |
| 69 Timer<LoadableTextTrack> m_loadTimer; | 72 Timer<LoadableTextTrack> m_loadTimer; |
| 70 OwnPtr<TextTrackLoader> m_loader; | 73 OwnPtrWillBeMember<TextTrackLoader> m_loader; |
| 71 KURL m_url; | 74 KURL m_url; |
| 72 bool m_isDefault; | 75 bool m_isDefault; |
| 73 }; | 76 }; |
| 74 } // namespace WebCore | 77 } // namespace WebCore |
| 75 | 78 |
| 76 #endif | 79 #endif |
| OLD | NEW |