Changeset 89711 in webkit
- Timestamp:
- Jun 24, 2011 4:06:01 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r89690 r89711 1978 1978 html/HTMLTrackElement.cpp 1979 1979 html/LoadableTextTrack.cpp 1980 html/LoadableTextTrackImpl.cpp1981 1980 html/MutableTextTrack.cpp 1982 html/MutableTextTrackImpl.cpp1983 1981 html/TextTrack.cpp 1984 1982 html/TextTrackCue.cpp -
trunk/Source/WebCore/ChangeLog
r89710 r89711 1 2011-06-24 Anna Cavender <annacc@chromium.org> 2 3 Reviewed by Eric Carlson. 4 5 Loading out-of-band text track files from <track>. 6 https://bugs.webkit.org/show_bug.cgi?id=62881 7 8 Uses the src attribute of <track> urls to load out-of-band text track 9 files using ThreadableLoader. Also removes TextTrackPrivateInterface 10 (as well as LoadableTextTrackImpl and MutableTextTrackImpl) classes. 11 12 No new tests because feature is hidden behind VIDEO_TRACK feature 13 define, which is turned off. 14 15 * CMakeLists.txt: 16 * GNUmakefile.am: 17 * GNUmakefile.list.am: 18 * WebCore.gypi: 19 * WebCore.pro: 20 * WebCore.xcodeproj/project.pbxproj: 21 * html/HTMLMediaElement.cpp: 22 * html/HTMLMediaElement.h: 23 * html/HTMLTrackElement.cpp: 24 * html/HTMLTrackElement.h: 25 * html/LoadableTextTrack.cpp: 26 * html/LoadableTextTrack.h: 27 * html/LoadableTextTrackImpl.cpp: Removed. 28 * html/LoadableTextTrackImpl.h: Removed. 29 * html/MutableTextTrack.cpp: 30 * html/MutableTextTrack.h: 31 * html/MutableTextTrackImpl.cpp: Removed. 32 * html/MutableTextTrackImpl.h: Removed. 33 * html/TextTrack.cpp: 34 * html/TextTrack.h: 35 * html/TextTrackPrivate.h: Removed. 36 * platform/track/CueParser.cpp: 37 * platform/track/CueParser.h: 38 1 39 2011-06-24 Rob Buis <rbuis@rim.com> 2 40 -
trunk/Source/WebCore/GNUmakefile.am
r89442 r89711 64 64 -I$(srcdir)/Source/WebCore/platform/text \ 65 65 -I$(srcdir)/Source/WebCore/platform/text/transcoder \ 66 -I$(srcdir)/Source/WebCore/platform/track \ 66 67 -I$(srcdir)/Source/WebCore/platform/win \ 67 68 -I$(srcdir)/Source/WebCore/plugins \ -
trunk/Source/WebCore/GNUmakefile.list.am
r89690 r89711 1597 1597 Source/WebCore/html/ColorInputType.cpp \ 1598 1598 Source/WebCore/html/ColorInputType.h \ 1599 Source/WebCore/html/CueIndex.cpp \ 1600 Source/WebCore/html/CueIndex.h \ 1599 1601 Source/WebCore/html/DateInputType.cpp \ 1600 1602 Source/WebCore/html/DateInputType.h \ … … 1806 1808 Source/WebCore/html/LinkRelAttribute.cpp \ 1807 1809 Source/WebCore/html/LinkRelAttribute.h \ 1810 Source/WebCore/html/LoadableTextTrack.cpp \ 1811 Source/WebCore/html/LoadableTextTrack.h \ 1808 1812 Source/WebCore/html/MediaDocument.cpp \ 1809 1813 Source/WebCore/html/MediaDocument.h \ … … 1811 1815 Source/WebCore/html/MonthInputType.cpp \ 1812 1816 Source/WebCore/html/MonthInputType.h \ 1817 Source/WebCore/html/MutableTextTrack.cpp \ 1818 Source/WebCore/html/MutableTextTrack.h \ 1813 1819 Source/WebCore/html/NumberInputType.cpp \ 1814 1820 Source/WebCore/html/NumberInputType.h \ … … 1899 1905 Source/WebCore/html/TextInputType.h \ 1900 1906 Source/WebCore/html/TextMetrics.h \ 1907 Source/WebCore/html/TextTrack.cpp \ 1908 Source/WebCore/html/TextTrack.h \ 1909 Source/WebCore/html/TextTrackCue.cpp \ 1910 Source/WebCore/html/TextTrackCue.h \ 1911 Source/WebCore/html/TextTrackCueList.cpp \ 1912 Source/WebCore/html/TextTrackCueList.h \ 1901 1913 Source/WebCore/html/TimeInputType.cpp \ 1902 1914 Source/WebCore/html/TimeInputType.h \ … … 2079 2091 Source/WebCore/loader/CrossOriginPreflightResultCache.cpp \ 2080 2092 Source/WebCore/loader/CrossOriginPreflightResultCache.h \ 2093 Source/WebCore/loader/CueLoader.cpp \ 2094 Source/WebCore/loader/CueLoader.h \ 2081 2095 Source/WebCore/loader/DocumentLoader.cpp \ 2082 2096 Source/WebCore/loader/DocumentLoader.h \ … … 2826 2840 Source/WebCore/platform/Timer.cpp \ 2827 2841 Source/WebCore/platform/Timer.h \ 2842 Source/WebCore/platform/track/CueParser.h \ 2843 Source/WebCore/platform/track/CueParser.cpp \ 2844 Source/WebCore/platform/track/CueParserPrivate.h \ 2828 2845 Source/WebCore/platform/TreeShared.h \ 2829 2846 Source/WebCore/platform/URLString.h \ -
trunk/Source/WebCore/WebCore.gypi
r89700 r89711 3048 3048 'html/LoadableTextTrack.cpp', 3049 3049 'html/LoadableTextTrack.h', 3050 'html/LoadableTextTrackImpl.cpp',3051 'html/LoadableTextTrackImpl.h',3052 3050 'html/MediaDocument.cpp', 3053 3051 'html/MediaDocument.h', … … 3055 3053 'html/MutableTextTrack.cpp', 3056 3054 'html/MutableTextTrack.h', 3057 'html/MutableTextTrackImpl.cpp',3058 'html/MutableTextTrackImpl.h',3059 3055 'html/MonthInputType.cpp', 3060 3056 'html/MonthInputType.h', … … 3092 3088 'html/TextTrackCueList.cpp', 3093 3089 'html/TextTrackCueList.h', 3094 'html/TextTrackPrivateInterface.h',3095 3090 'html/TimeInputType.cpp', 3096 3091 'html/TimeInputType.h', -
trunk/Source/WebCore/WebCore.pro
r89690 r89711 1737 1737 html/LinkRelAttribute.h \ 1738 1738 html/LoadableTextTrack.h \ 1739 html/LoadableTextTrackImpl.h \1740 1739 html/MediaDocument.h \ 1741 1740 html/MutableTextTrack.h \ 1742 html/MutableTextTrackImpl.h \1743 1741 html/PluginDocument.h \ 1744 1742 html/StepRange.h \ … … 1747 1745 html/TextTrackCue.h \ 1748 1746 html/TextTrackCueList.h \ 1749 html/TextTrackPrivate.h \1750 1747 html/TimeRanges.h \ 1751 1748 html/ValidityState.h \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r89690 r89711 4026 4026 B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */; }; 4027 4027 B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */; }; 4028 B1AD4E6013A12A0B00846B27 /* LoadableTextTrackImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */; };4029 B1AD4E6113A12A0B00846B27 /* LoadableTextTrackImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */; };4030 4028 B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */; }; 4031 4029 B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */; }; 4032 B1AD4E6413A12A0B00846B27 /* MutableTextTrackImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */; };4033 B1AD4E6513A12A0B00846B27 /* MutableTextTrackImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */; };4034 4030 B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */; }; 4035 4031 B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5613A12A0B00846B27 /* TextTrack.h */; }; … … 4038 4034 B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */; }; 4039 4035 B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */; }; 4040 B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */; };4041 4036 B1AD4E7313A12A4600846B27 /* CueLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E7113A12A4600846B27 /* CueLoader.cpp */; }; 4042 4037 B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E7213A12A4600846B27 /* CueLoader.h */; }; … … 10464 10459 B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoadableTextTrack.cpp; path = html/LoadableTextTrack.cpp; sourceTree = SOURCE_ROOT; }; 10465 10460 B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoadableTextTrack.h; path = html/LoadableTextTrack.h; sourceTree = SOURCE_ROOT; }; 10466 B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoadableTextTrackImpl.cpp; path = html/LoadableTextTrackImpl.cpp; sourceTree = SOURCE_ROOT; };10467 B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoadableTextTrackImpl.h; path = html/LoadableTextTrackImpl.h; sourceTree = SOURCE_ROOT; };10468 10461 B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableTextTrack.cpp; path = html/MutableTextTrack.cpp; sourceTree = SOURCE_ROOT; }; 10469 10462 B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutableTextTrack.h; path = html/MutableTextTrack.h; sourceTree = SOURCE_ROOT; }; 10470 B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableTextTrackImpl.cpp; path = html/MutableTextTrackImpl.cpp; sourceTree = SOURCE_ROOT; };10471 B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutableTextTrackImpl.h; path = html/MutableTextTrackImpl.h; sourceTree = SOURCE_ROOT; };10472 10463 B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrack.cpp; path = html/TextTrack.cpp; sourceTree = SOURCE_ROOT; }; 10473 10464 B1AD4E5613A12A0B00846B27 /* TextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrack.h; path = html/TextTrack.h; sourceTree = SOURCE_ROOT; }; … … 10476 10467 B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrackCueList.cpp; path = html/TextTrackCueList.cpp; sourceTree = SOURCE_ROOT; }; 10477 10468 B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackCueList.h; path = html/TextTrackCueList.h; sourceTree = SOURCE_ROOT; }; 10478 B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackPrivate.h; path = html/TextTrackPrivate.h; sourceTree = SOURCE_ROOT; };10479 10469 B1AD4E7113A12A4600846B27 /* CueLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CueLoader.cpp; path = loader/CueLoader.cpp; sourceTree = SOURCE_ROOT; }; 10480 10470 B1AD4E7213A12A4600846B27 /* CueLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CueLoader.h; path = loader/CueLoader.h; sourceTree = SOURCE_ROOT; }; … … 13657 13647 B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */, 13658 13648 B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */, 13659 B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */,13660 B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */,13661 13649 B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */, 13662 13650 B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */, 13663 B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */,13664 B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */,13665 13651 B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */, 13666 13652 B1AD4E5613A12A0B00846B27 /* TextTrack.h */, … … 13669 13655 B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */, 13670 13656 B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */, 13671 B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */,13672 13657 41815C1B138319630057AAA4 /* js */, 13673 13658 417DA4CF13734326007C57FB /* Internals.cpp */, … … 23058 23043 B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */, 23059 23044 B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */, 23060 B1AD4E6113A12A0B00846B27 /* LoadableTextTrackImpl.h in Headers */,23061 23045 B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */, 23062 B1AD4E6513A12A0B00846B27 /* MutableTextTrackImpl.h in Headers */,23063 23046 B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */, 23064 23047 B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */, 23065 23048 B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */, 23066 B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */,23067 23049 B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */, 23068 23050 B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */, … … 25819 25801 B1AD4E5C13A12A0B00846B27 /* CueIndex.cpp in Sources */, 25820 25802 B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */, 25821 B1AD4E6013A12A0B00846B27 /* LoadableTextTrackImpl.cpp in Sources */,25822 25803 B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */, 25823 B1AD4E6413A12A0B00846B27 /* MutableTextTrackImpl.cpp in Sources */,25824 25804 B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */, 25825 25805 B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */, -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r89172 r89711 83 83 #include "RenderEmbeddedObject.h" 84 84 #include "Widget.h" 85 #endif 86 87 #if ENABLE(VIDEO_TRACK) 88 #include "HTMLTrackElement.h" 85 89 #endif 86 90 … … 591 595 592 596 selectMediaResource(); 597 #if ENABLE(VIDEO_TRACK) 598 loadTextTracks(); 599 #endif 593 600 } 594 601 … … 766 773 renderer()->updateFromElement(); 767 774 } 775 776 #if ENABLE(VIDEO_TRACK) 777 void HTMLMediaElement::loadTextTracks() 778 { 779 for (Node* node = firstChild(); node; node = node->nextSibling()) { 780 if (node->hasTagName(trackTag)) { 781 HTMLTrackElement* track = static_cast<HTMLTrackElement*>(node); 782 track->load(ActiveDOMObject::scriptExecutionContext()); 783 } 784 } 785 } 786 #endif 768 787 769 788 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidSourceAction actionIfInvalid) -
trunk/Source/WebCore/html/HTMLMediaElement.h
r89044 r89711 301 301 void mediaLoadingFailed(MediaPlayer::NetworkState); 302 302 303 #if ENABLE(VIDEO_TRACK) 304 void loadTextTracks(); 305 #endif 306 303 307 // These "internal" functions do not check user gesture restrictions. 304 308 void loadInternal(); -
trunk/Source/WebCore/html/HTMLTrackElement.cpp
r83952 r89711 44 44 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); 45 45 ASSERT(hasTagName(trackTag)); 46 } 47 48 HTMLTrackElement::~HTMLTrackElement() 49 { 46 50 } 47 51 … … 124 128 } 125 129 130 void HTMLTrackElement::load(ScriptExecutionContext* context) 131 { 132 m_track = LoadableTextTrack::create(kind(), label(), srclang(), isDefault()); 133 134 if (hasAttribute(srcAttr)) 135 m_track->load(getNonEmptyURLAttribute(srcAttr), context); 136 } 137 126 138 } 127 139 -
trunk/Source/WebCore/html/HTMLTrackElement.h
r83952 r89711 30 30 31 31 #include "HTMLElement.h" 32 #include "LoadableTextTrack.h" 32 33 33 34 namespace WebCore { … … 48 49 void setLabel(const String&); 49 50 void setIsDefault(bool); 51 52 void load(ScriptExecutionContext*); 50 53 51 54 private: 52 55 HTMLTrackElement(const QualifiedName&, Document*); 56 virtual ~HTMLTrackElement(); 53 57 54 58 virtual void insertedIntoTree(bool); 55 59 virtual void willRemove(); 56 60 virtual bool isURLAttribute(Attribute*) const; 61 62 RefPtr<LoadableTextTrack> m_track; 57 63 }; 58 64 -
trunk/Source/WebCore/html/LoadableTextTrack.cpp
r89186 r89711 33 33 34 34 LoadableTextTrack::LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault) 35 : TextTrack(kind, label, language) 36 , m_isDefault(isDefault) 35 37 { 36 // FIXME(62881): Implement.37 m_private = LoadableTextTrackImpl::create(kind, label, language, isDefault);38 38 } 39 39 40 40 LoadableTextTrack::~LoadableTextTrack() 41 41 { 42 // FIXME(62881): Implement.43 42 } 44 43 45 void LoadableTextTrack::load(const String& )44 void LoadableTextTrack::load(const String& url, ScriptExecutionContext* context) 46 45 { 47 // FIXME(62881): Implement. 46 return m_parser.load(url, context, this); 47 } 48 49 bool LoadableTextTrack::supportsType(const String& url) 50 { 51 return m_parser.supportsType(url); 52 } 53 54 void LoadableTextTrack::newCuesParsed() 55 { 56 // FIXME(62883): Fetch new cues from parser and temporarily store to give to CueLoaderClient when fetchNewCuesFromLoader is called. 57 } 58 59 void LoadableTextTrack::trackLoadStarted() 60 { 61 setReadyState(TextTrack::LOADING); 62 } 63 64 void LoadableTextTrack::trackLoadError() 65 { 66 setReadyState(TextTrack::ERROR); 67 } 68 69 void LoadableTextTrack::trackLoadCompleted() 70 { 71 setReadyState(TextTrack::LOADED); 72 } 73 74 void LoadableTextTrack::newCuesLoaded() 75 { 76 // FIXME(62885): Tell the client to fetch the latest cues. 77 } 78 79 void LoadableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&) 80 { 81 // FIXME(62885): Implement. 48 82 } 49 83 -
trunk/Source/WebCore/html/LoadableTextTrack.h
r89186 r89711 29 29 #if ENABLE(VIDEO_TRACK) 30 30 31 #include " LoadableTextTrackImpl.h"32 #include " PassRefPtr.h"31 #include "CueLoader.h" 32 #include "CueParser.h" 33 33 #include "TextTrack.h" 34 34 #include "TextTrackCueList.h" 35 #include <wtf/PassRefPtr.h> 36 #include <wtf/Vector.h> 35 37 36 38 namespace WebCore { 37 39 38 class LoadableTextTrack : public TextTrack { 40 class ScriptExecutionContext; 41 class TextTrack; 42 class TextTrackCue; 43 44 class LoadableTextTrack : public TextTrack, public CueParserClient, public CueLoader { 39 45 public: 40 46 static PassRefPtr<LoadableTextTrack> create(const String& kind, const String& label, const String& language, bool isDefault) … … 44 50 virtual ~LoadableTextTrack(); 45 51 46 void load(const String&); 52 void load(const String&, ScriptExecutionContext*); 53 bool supportsType(const String&); 54 55 virtual void newCuesParsed(); 56 virtual void trackLoadStarted(); 57 virtual void trackLoadError(); 58 virtual void trackLoadCompleted(); 59 60 virtual void newCuesLoaded(); 61 virtual void fetchNewestCues(Vector<TextTrackCue*>&); 47 62 48 63 private: 49 64 LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault); 50 65 66 CueParser m_parser; 67 68 bool m_isDefault; 51 69 }; 52 70 } // namespace WebCore -
trunk/Source/WebCore/html/MutableTextTrack.cpp
r89186 r89711 30 30 #include "MutableTextTrack.h" 31 31 32 #include "MutableTextTrackImpl.h" 32 #include "TextTrack.h" 33 #include "TextTrackCue.h" 33 34 34 35 namespace WebCore { 35 36 36 37 MutableTextTrack::MutableTextTrack(const String& kind, const String& label, const String& language) 38 : TextTrack(kind, label, language) 37 39 { 38 m_private = MutableTextTrackImpl::create(kind, label, language);39 40 } 40 41 … … 49 50 } 50 51 52 void MutableTextTrack::newCuesLoaded() 53 { 54 // FIXME(62890): Implement. 55 } 56 57 void MutableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&) 58 { 59 // FIXME(62890): Implement. 60 } 61 51 62 } // namespace WebCore 52 63 -
trunk/Source/WebCore/html/MutableTextTrack.h
r89186 r89711 29 29 #if ENABLE(VIDEO_TRACK) 30 30 31 #include "CueLoader.h" 31 32 #include "TextTrack.h" 33 #include <wtf/PassRefPtr.h> 34 #include <wtf/Vector.h> 32 35 33 36 namespace WebCore { … … 35 38 class TextTrackCue; 36 39 37 class MutableTextTrack : public TextTrack {40 class MutableTextTrack : public TextTrack, public CueLoader { 38 41 public: 39 42 static PassRefPtr<MutableTextTrack> create(const String& kind, const String& label, const String& language) … … 45 48 void addCue(PassRefPtr<TextTrackCue>); 46 49 void removeCue(PassRefPtr<TextTrackCue>); 50 51 virtual void newCuesLoaded(); 52 virtual void fetchNewestCues(Vector<TextTrackCue*>&); 53 47 54 private: 48 55 MutableTextTrack(const String& kind, const String& label, const String& language); -
trunk/Source/WebCore/html/TextTrack.cpp
r89186 r89711 36 36 37 37 #include "TextTrackCueList.h" 38 #include "TextTrackPrivate.h"39 38 40 39 namespace WebCore { 41 40 42 class NullTextTrackPrivate : public TextTrackPrivateInterface { 43 public: 44 NullTextTrackPrivate(); 45 virtual ~NullTextTrackPrivate(); 46 47 // TextTrackPrivateInterface methods 48 virtual String kind() const { return emptyString(); } 49 virtual String label() const { return emptyString(); } 50 virtual String language() const { return emptyString(); } 51 virtual TextTrack::ReadyState readyState() const { return TextTrack::NONE; } 52 virtual TextTrack::Mode mode() const { return TextTrack::OFF; } 53 virtual void setMode(TextTrack::Mode) { } 54 virtual PassRefPtr<TextTrackCueList> cues() const { return 0; } 55 virtual PassRefPtr<TextTrackCueList> activeCues() const { return 0; } 56 virtual void load(const String&) { } 57 }; 58 59 static PassOwnPtr<NullTextTrackPrivate> createNullTextTrackPrivate() 60 { 61 return adoptPtr(new NullTextTrackPrivate()); 62 } 63 64 TextTrack::TextTrack() 65 : m_private(createNullTextTrackPrivate()) 41 TextTrack::TextTrack(const String& kind, const String& label, const String& language) 42 : m_kind(kind) 43 , m_label(label) 44 , m_language(language) 45 , m_readyState(TextTrack::NONE) 46 , m_mode(TextTrack::SHOWING) 66 47 { 67 48 } … … 73 54 String TextTrack::kind() const 74 55 { 75 return m_ private->kind();56 return m_kind; 76 57 } 77 58 78 59 String TextTrack::label() const 79 60 { 80 return m_ private->label();61 return m_label; 81 62 } 82 63 83 64 String TextTrack::language() const 84 65 { 85 return m_ private->language();66 return m_language; 86 67 } 87 68 88 69 TextTrack::ReadyState TextTrack::readyState() const 89 70 { 90 return m_private->readyState(); 71 return m_readyState; 72 } 73 74 void TextTrack::setReadyState(ReadyState state) 75 { 76 m_readyState = state; 91 77 } 92 78 93 79 TextTrack::Mode TextTrack::mode() const 94 80 { 95 return m_ private->mode();81 return m_mode; 96 82 } 97 83 … … 101 87 // the user agent must throw an INVALID_ACCESS_ERR exception. 102 88 if (mode == TextTrack::OFF || mode == TextTrack::HIDDEN || mode == TextTrack::SHOWING) 103 m_ private->setMode(static_cast<Mode>(mode));89 m_mode = static_cast<Mode>(mode); 104 90 else 105 91 ec = INVALID_ACCESS_ERR; … … 108 94 PassRefPtr<TextTrackCueList> TextTrack::cues() const 109 95 { 110 return m_private->cues(); 96 // FIXME(62885): Implement. 97 return 0; 111 98 } 112 99 113 100 PassRefPtr<TextTrackCueList> TextTrack::activeCues() const 114 101 { 115 return m_private->activeCues(); 102 // FIXME(62885): Implement. 103 return 0; 116 104 } 117 105 -
trunk/Source/WebCore/html/TextTrack.h
r89186 r89711 38 38 class TextTrack; 39 39 class TextTrackCueList; 40 class TextTrackPrivateInterface;41 40 42 41 class TextTrackClient { … … 50 49 class TextTrack : public RefCounted<TextTrack> { 51 50 public: 52 static PassRefPtr<TextTrack> create( )51 static PassRefPtr<TextTrack> create(const String& kind, const String& label, const String& language) 53 52 { 54 return adoptRef(new TextTrack );53 return adoptRef(new TextTrack(kind, label, language)); 55 54 } 56 55 virtual ~TextTrack(); … … 74 73 75 74 protected: 76 TextTrack(); 77 OwnPtr<TextTrackPrivateInterface> m_private; 75 TextTrack(const String& kind, const String& label, const String& language); 76 77 void setReadyState(ReadyState); 78 79 RefPtr<TextTrackCueList> m_cues; 80 81 private: 82 String m_kind; 83 String m_label; 84 String m_language; 85 TextTrack::ReadyState m_readyState; 86 TextTrack::Mode m_mode; 78 87 79 88 }; -
trunk/Source/WebCore/platform/track/CueParser.cpp
r89186 r89711 35 35 #include "CueParser.h" 36 36 37 #include "ResourceRequest.h" 38 #include "ThreadableLoader.h" 39 37 40 namespace WebCore { 38 41 … … 44 47 CueParser::~CueParser() 45 48 { 49 if (m_loader) 50 m_loader->cancel(); 51 m_loader = 0; 46 52 } 47 53 48 void CueParser::load(const String& )54 void CueParser::load(const String& url, ScriptExecutionContext* context, CueParserClient* client) 49 55 { 50 // FIXME(62881): Implement. 56 ResourceRequest request(url); 57 58 ThreadableLoaderOptions options; 59 options.sendLoadCallbacks = true; 60 options.crossOriginRequestPolicy = AllowCrossOriginRequests; 61 62 m_client = client; 63 64 m_loader = ThreadableLoader::create(context, this, request, options); 51 65 } 52 66 53 void CueParser::didReceiveData(const char*, int)67 bool CueParser::supportsType(const String& url) 54 68 { 55 // FIXME(62881): Implement. 69 // FIXME(62893): check against a list of supported types 70 return false; 56 71 } 57 72 58 void CueParser::fetchParsedCues(Vector<PassRefPtr<TextTrackCue> >&) 73 void CueParser::didReceiveResponse(unsigned long /*identifier*/, const ResourceResponse&) 74 { 75 // FIXME(62893): Create m_private based on MIME type. 76 m_client->trackLoadStarted(); 77 } 78 79 void CueParser::didReceiveData(const char* data, int len) 80 { 81 // FIXME(62893): Send data along to m_private parser to be parsed. 82 } 83 84 void CueParser::didFinishLoading(unsigned long) 85 { 86 m_client->trackLoadCompleted(); 87 } 88 89 void CueParser::didFail(const ResourceError&) 90 { 91 m_client->trackLoadError(); 92 } 93 94 void CueParser::fetchParsedCues(Vector<RefPtr<TextTrackCue> >&) 59 95 { 60 96 // FIXME(62893): Implement. -
trunk/Source/WebCore/platform/track/CueParser.h
r89186 r89711 43 43 namespace WebCore { 44 44 45 class ScriptExecutionContext; 45 46 class TextTrackCue; 47 48 class CueParserClient { 49 public: 50 virtual void newCuesParsed() = 0; 51 virtual void trackLoadStarted() = 0; 52 virtual void trackLoadError() = 0; 53 virtual void trackLoadCompleted() = 0; 54 }; 46 55 47 56 class CueParser : public ThreadableLoaderClient { … … 50 59 virtual ~CueParser(); 51 60 52 // ThreadableLoaderClient methods.61 void didReceiveResponse(unsigned long, const ResourceResponse&); 53 62 void didReceiveData(const char*, int); 63 void didFinishLoading(unsigned long); 64 void didFail(const ResourceError&); 54 65 55 void load(const String&); 56 void fetchParsedCues(Vector<PassRefPtr<TextTrackCue> >&); 66 void load(const String&, ScriptExecutionContext*, CueParserClient*); 67 bool supportsType(const String&); 68 69 void fetchParsedCues(Vector<RefPtr<TextTrackCue> >&); 57 70 58 71 private: 59 72 RefPtr<ThreadableLoader> m_loader; 60 73 OwnPtr<CueParserPrivateInterface> m_private; 74 CueParserClient* m_client; 61 75 }; 62 76
Note: See TracChangeset
for help on using the changeset viewer.