2011-06-24 Anna Cavender <annacc@chromium.org>
authorhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2011 23:06:01 +0000 (23:06 +0000)
committerhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2011 23:06:01 +0000 (23:06 +0000)
        Reviewed by Eric Carlson.

        Loading out-of-band text track files from <track>.
        https://bugs.webkit.org/show_bug.cgi?id=62881

        Uses the src attribute of <track> urls to load out-of-band text track
        files using ThreadableLoader.  Also removes TextTrackPrivateInterface
        (as well as LoadableTextTrackImpl and MutableTextTrackImpl) classes.

        No new tests because feature is hidden behind VIDEO_TRACK feature
        define, which is turned off.

        * CMakeLists.txt:
        * GNUmakefile.am:
        * GNUmakefile.list.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        * html/HTMLMediaElement.h:
        * html/HTMLTrackElement.cpp:
        * html/HTMLTrackElement.h:
        * html/LoadableTextTrack.cpp:
        * html/LoadableTextTrack.h:
        * html/LoadableTextTrackImpl.cpp: Removed.
        * html/LoadableTextTrackImpl.h: Removed.
        * html/MutableTextTrack.cpp:
        * html/MutableTextTrack.h:
        * html/MutableTextTrackImpl.cpp: Removed.
        * html/MutableTextTrackImpl.h: Removed.
        * html/TextTrack.cpp:
        * html/TextTrack.h:
        * html/TextTrackPrivate.h: Removed.
        * platform/track/CueParser.cpp:
        * platform/track/CueParser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89711 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/HTMLTrackElement.h
Source/WebCore/html/LoadableTextTrack.cpp
Source/WebCore/html/LoadableTextTrack.h
Source/WebCore/html/LoadableTextTrackImpl.cpp [deleted file]
Source/WebCore/html/LoadableTextTrackImpl.h [deleted file]
Source/WebCore/html/MutableTextTrack.cpp
Source/WebCore/html/MutableTextTrack.h
Source/WebCore/html/MutableTextTrackImpl.cpp [deleted file]
Source/WebCore/html/MutableTextTrackImpl.h [deleted file]
Source/WebCore/html/TextTrack.cpp
Source/WebCore/html/TextTrack.h
Source/WebCore/html/TextTrackPrivate.h [deleted file]
Source/WebCore/platform/track/CueParser.cpp
Source/WebCore/platform/track/CueParser.h

index cce627a..c4a087f 100644 (file)
@@ -1977,9 +1977,7 @@ IF (ENABLE_VIDEO_TRACK)
         html/CueIndex.cpp
         html/HTMLTrackElement.cpp
         html/LoadableTextTrack.cpp
-        html/LoadableTextTrackImpl.cpp
         html/MutableTextTrack.cpp
-        html/MutableTextTrackImpl.cpp
         html/TextTrack.cpp
         html/TextTrackCue.cpp
         html/TextTrackCueList.cpp
index b8c556f..8fc8347 100644 (file)
@@ -1,3 +1,41 @@
+2011-06-24  Anna Cavender  <annacc@chromium.org>
+
+        Reviewed by Eric Carlson.
+
+        Loading out-of-band text track files from <track>.
+        https://bugs.webkit.org/show_bug.cgi?id=62881
+
+        Uses the src attribute of <track> urls to load out-of-band text track
+        files using ThreadableLoader.  Also removes TextTrackPrivateInterface
+        (as well as LoadableTextTrackImpl and MutableTextTrackImpl) classes.
+
+        No new tests because feature is hidden behind VIDEO_TRACK feature
+        define, which is turned off.
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLMediaElement.cpp:
+        * html/HTMLMediaElement.h:
+        * html/HTMLTrackElement.cpp:
+        * html/HTMLTrackElement.h:
+        * html/LoadableTextTrack.cpp:
+        * html/LoadableTextTrack.h:
+        * html/LoadableTextTrackImpl.cpp: Removed.
+        * html/LoadableTextTrackImpl.h: Removed.
+        * html/MutableTextTrack.cpp:
+        * html/MutableTextTrack.h:
+        * html/MutableTextTrackImpl.cpp: Removed.
+        * html/MutableTextTrackImpl.h: Removed.
+        * html/TextTrack.cpp:
+        * html/TextTrack.h:
+        * html/TextTrackPrivate.h: Removed.
+        * platform/track/CueParser.cpp:
+        * platform/track/CueParser.h:
+
 2011-06-24  Rob Buis  <rbuis@rim.com>
 
         Rubber-stamped by Nikolas Zimmermann.
index 968d7fb..fcf1b1f 100644 (file)
@@ -63,6 +63,7 @@ webcore_cppflags += \
        -I$(srcdir)/Source/WebCore/platform/sql \
        -I$(srcdir)/Source/WebCore/platform/text \
        -I$(srcdir)/Source/WebCore/platform/text/transcoder \
+       -I$(srcdir)/Source/WebCore/platform/track \
        -I$(srcdir)/Source/WebCore/platform/win \
        -I$(srcdir)/Source/WebCore/plugins \
        -I$(srcdir)/Source/WebCore/plugins/win \
index e23abdb..377dacd 100644 (file)
@@ -1596,6 +1596,8 @@ webcore_sources += \
        Source/WebCore/html/CollectionType.h \
        Source/WebCore/html/ColorInputType.cpp \
        Source/WebCore/html/ColorInputType.h \
+       Source/WebCore/html/CueIndex.cpp \
+       Source/WebCore/html/CueIndex.h \
        Source/WebCore/html/DateInputType.cpp \
        Source/WebCore/html/DateInputType.h \
        Source/WebCore/html/DateTimeInputType.cpp \
@@ -1805,11 +1807,15 @@ webcore_sources += \
        Source/WebCore/html/LabelsNodeList.h \
        Source/WebCore/html/LinkRelAttribute.cpp \
        Source/WebCore/html/LinkRelAttribute.h \
+       Source/WebCore/html/LoadableTextTrack.cpp \
+       Source/WebCore/html/LoadableTextTrack.h \
        Source/WebCore/html/MediaDocument.cpp \
        Source/WebCore/html/MediaDocument.h \
        Source/WebCore/html/MediaError.h \
        Source/WebCore/html/MonthInputType.cpp \
        Source/WebCore/html/MonthInputType.h \
+       Source/WebCore/html/MutableTextTrack.cpp \
+       Source/WebCore/html/MutableTextTrack.h \
        Source/WebCore/html/NumberInputType.cpp \
        Source/WebCore/html/NumberInputType.h \
        Source/WebCore/html/parser/CSSPreloadScanner.cpp \
@@ -1898,6 +1904,12 @@ webcore_sources += \
        Source/WebCore/html/TextInputType.cpp \
        Source/WebCore/html/TextInputType.h \
        Source/WebCore/html/TextMetrics.h \
+       Source/WebCore/html/TextTrack.cpp \
+       Source/WebCore/html/TextTrack.h \
+       Source/WebCore/html/TextTrackCue.cpp \
+       Source/WebCore/html/TextTrackCue.h \
+       Source/WebCore/html/TextTrackCueList.cpp \
+       Source/WebCore/html/TextTrackCueList.h \
        Source/WebCore/html/TimeInputType.cpp \
        Source/WebCore/html/TimeInputType.h \
        Source/WebCore/html/TimeRanges.cpp \
@@ -2078,6 +2090,8 @@ webcore_sources += \
        Source/WebCore/loader/CrossOriginAccessControl.h \
        Source/WebCore/loader/CrossOriginPreflightResultCache.cpp \
        Source/WebCore/loader/CrossOriginPreflightResultCache.h \
+       Source/WebCore/loader/CueLoader.cpp \
+       Source/WebCore/loader/CueLoader.h \
        Source/WebCore/loader/DocumentLoader.cpp \
        Source/WebCore/loader/DocumentLoader.h \
        Source/WebCore/loader/DocumentLoadTiming.h \
@@ -2825,6 +2839,9 @@ webcore_sources += \
        Source/WebCore/platform/ThreadTimers.h \
        Source/WebCore/platform/Timer.cpp \
        Source/WebCore/platform/Timer.h \
+       Source/WebCore/platform/track/CueParser.h \
+       Source/WebCore/platform/track/CueParser.cpp \
+       Source/WebCore/platform/track/CueParserPrivate.h \
        Source/WebCore/platform/TreeShared.h \
        Source/WebCore/platform/URLString.h \
        Source/WebCore/platform/UUID.cpp \
index 8f99bac..0589b4b 100644 (file)
             'html/LinkRelAttribute.h',
             'html/LoadableTextTrack.cpp',
             'html/LoadableTextTrack.h',
-            'html/LoadableTextTrackImpl.cpp',
-            'html/LoadableTextTrackImpl.h',
             'html/MediaDocument.cpp',
             'html/MediaDocument.h',
             'html/MediaError.h',
             'html/MutableTextTrack.cpp',
             'html/MutableTextTrack.h',
-            'html/MutableTextTrackImpl.cpp',
-            'html/MutableTextTrackImpl.h',
             'html/MonthInputType.cpp',
             'html/MonthInputType.h',
             'html/NumberInputType.cpp',
             'html/TextTrackCue.h',
             'html/TextTrackCueList.cpp',
             'html/TextTrackCueList.h',
-            'html/TextTrackPrivateInterface.h',
             'html/TimeInputType.cpp',
             'html/TimeInputType.h',
             'html/TimeRanges.cpp',
index 0468c09..1283f91 100644 (file)
@@ -1736,17 +1736,14 @@ HEADERS += \
     html/LabelsNodeList.h \
     html/LinkRelAttribute.h \
     html/LoadableTextTrack.h \
-    html/LoadableTextTrackImpl.h \
     html/MediaDocument.h \
     html/MutableTextTrack.h \
-    html/MutableTextTrackImpl.h \
     html/PluginDocument.h \
     html/StepRange.h \
     html/TextDocument.h \
     html/TextTrack.h \
     html/TextTrackCue.h \
     html/TextTrackCueList.h \
-    html/TextTrackPrivate.h \
     html/TimeRanges.h \
     html/ValidityState.h \
     html/parser/CSSPreloadScanner.h \
index 397d3da..d888dc6 100644 (file)
                B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E4C13A12A0B00846B27 /* CueIndex.h */; };
                B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */; };
                B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */; };
-               B1AD4E6013A12A0B00846B27 /* LoadableTextTrackImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */; };
-               B1AD4E6113A12A0B00846B27 /* LoadableTextTrackImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */; };
                B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */; };
                B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */; };
-               B1AD4E6413A12A0B00846B27 /* MutableTextTrackImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */; };
-               B1AD4E6513A12A0B00846B27 /* MutableTextTrackImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */; };
                B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */; };
                B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5613A12A0B00846B27 /* TextTrack.h */; };
                B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5713A12A0B00846B27 /* TextTrackCue.cpp */; };
                B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5813A12A0B00846B27 /* TextTrackCue.h */; };
                B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */; };
                B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */; };
-               B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */; };
                B1AD4E7313A12A4600846B27 /* CueLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E7113A12A4600846B27 /* CueLoader.cpp */; };
                B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E7213A12A4600846B27 /* CueLoader.h */; };
                B1AD4E7B13A12A7200846B27 /* CueParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E7813A12A7200846B27 /* CueParser.cpp */; };
                B1AD4E4C13A12A0B00846B27 /* CueIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CueIndex.h; path = html/CueIndex.h; sourceTree = SOURCE_ROOT; };
                B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoadableTextTrack.cpp; path = html/LoadableTextTrack.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoadableTextTrack.h; path = html/LoadableTextTrack.h; sourceTree = SOURCE_ROOT; };
-               B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoadableTextTrackImpl.cpp; path = html/LoadableTextTrackImpl.cpp; sourceTree = SOURCE_ROOT; };
-               B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoadableTextTrackImpl.h; path = html/LoadableTextTrackImpl.h; sourceTree = SOURCE_ROOT; };
                B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableTextTrack.cpp; path = html/MutableTextTrack.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutableTextTrack.h; path = html/MutableTextTrack.h; sourceTree = SOURCE_ROOT; };
-               B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableTextTrackImpl.cpp; path = html/MutableTextTrackImpl.cpp; sourceTree = SOURCE_ROOT; };
-               B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutableTextTrackImpl.h; path = html/MutableTextTrackImpl.h; sourceTree = SOURCE_ROOT; };
                B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrack.cpp; path = html/TextTrack.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E5613A12A0B00846B27 /* TextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrack.h; path = html/TextTrack.h; sourceTree = SOURCE_ROOT; };
                B1AD4E5713A12A0B00846B27 /* TextTrackCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrackCue.cpp; path = html/TextTrackCue.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E5813A12A0B00846B27 /* TextTrackCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackCue.h; path = html/TextTrackCue.h; sourceTree = SOURCE_ROOT; };
                B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrackCueList.cpp; path = html/TextTrackCueList.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackCueList.h; path = html/TextTrackCueList.h; sourceTree = SOURCE_ROOT; };
-               B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackPrivate.h; path = html/TextTrackPrivate.h; sourceTree = SOURCE_ROOT; };
                B1AD4E7113A12A4600846B27 /* CueLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CueLoader.cpp; path = loader/CueLoader.cpp; sourceTree = SOURCE_ROOT; };
                B1AD4E7213A12A4600846B27 /* CueLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CueLoader.h; path = loader/CueLoader.h; sourceTree = SOURCE_ROOT; };
                B1AD4E7813A12A7200846B27 /* CueParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CueParser.cpp; sourceTree = "<group>"; };
                                B1AD4E4C13A12A0B00846B27 /* CueIndex.h */,
                                B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */,
                                B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */,
-                               B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */,
-                               B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */,
                                B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */,
                                B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */,
-                               B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */,
-                               B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */,
                                B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */,
                                B1AD4E5613A12A0B00846B27 /* TextTrack.h */,
                                B1AD4E5713A12A0B00846B27 /* TextTrackCue.cpp */,
                                B1AD4E5813A12A0B00846B27 /* TextTrackCue.h */,
                                B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */,
                                B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */,
-                               B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */,
                                41815C1B138319630057AAA4 /* js */,
                                417DA4CF13734326007C57FB /* Internals.cpp */,
                                417DA4CE13734326007C57FB /* Internals.h */,
                                FDF7E9C413AC21DB00A51EAC /* JSAudioBufferCallback.h in Headers */,
                                B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */,
                                B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */,
-                               B1AD4E6113A12A0B00846B27 /* LoadableTextTrackImpl.h in Headers */,
                                B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */,
-                               B1AD4E6513A12A0B00846B27 /* MutableTextTrackImpl.h in Headers */,
                                B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */,
                                B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */,
                                B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */,
-                               B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */,
                                B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */,
                                B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */,
                                B1AD4E7D13A12A7200846B27 /* CueParserPrivate.h in Headers */,
                                FDF7E9C313AC21DB00A51EAC /* JSAudioBufferCallback.cpp in Sources */,
                                B1AD4E5C13A12A0B00846B27 /* CueIndex.cpp in Sources */,
                                B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */,
-                               B1AD4E6013A12A0B00846B27 /* LoadableTextTrackImpl.cpp in Sources */,
                                B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */,
-                               B1AD4E6413A12A0B00846B27 /* MutableTextTrackImpl.cpp in Sources */,
                                B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */,
                                B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */,
                                B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */,
index c383cc9..fac9a92 100644 (file)
 #include "Widget.h"
 #endif
 
+#if ENABLE(VIDEO_TRACK)
+#include "HTMLTrackElement.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -590,6 +594,9 @@ void HTMLMediaElement::loadInternal()
     }
 
     selectMediaResource();
+#if ENABLE(VIDEO_TRACK)
+    loadTextTracks();
+#endif
 }
 
 void HTMLMediaElement::selectMediaResource()
@@ -766,6 +773,18 @@ void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content
         renderer()->updateFromElement();
 }
 
+#if ENABLE(VIDEO_TRACK)
+void HTMLMediaElement::loadTextTracks()
+{
+    for (Node* node = firstChild(); node; node = node->nextSibling()) {
+        if (node->hasTagName(trackTag)) {
+            HTMLTrackElement* track = static_cast<HTMLTrackElement*>(node);
+            track->load(ActiveDOMObject::scriptExecutionContext());
+        }
+    }
+}
+#endif
+
 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidSourceAction actionIfInvalid)
 {
     if (!url.isValid()) {
index e1ec459..6238b04 100644 (file)
@@ -300,6 +300,10 @@ private:
     KURL selectNextSourceChild(ContentType*, InvalidSourceAction);
     void mediaLoadingFailed(MediaPlayer::NetworkState);
 
+#if ENABLE(VIDEO_TRACK)
+    void loadTextTracks();
+#endif
+
     // These "internal" functions do not check user gesture restrictions.
     void loadInternal();
     void playInternal();
index 63f2788..3aabacc 100644 (file)
@@ -45,6 +45,10 @@ inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document
     ASSERT(hasTagName(trackTag));
 }
 
+HTMLTrackElement::~HTMLTrackElement()
+{
+}
+
 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagName, Document* document)
 {
     return adoptRef(new HTMLTrackElement(tagName, document));
@@ -123,6 +127,14 @@ bool HTMLTrackElement::isURLAttribute(Attribute* attribute) const
     return attribute->name() == srcAttr;
 }
 
+void HTMLTrackElement::load(ScriptExecutionContext* context)
+{
+    m_track = LoadableTextTrack::create(kind(), label(), srclang(), isDefault());
+
+    if (hasAttribute(srcAttr))
+        m_track->load(getNonEmptyURLAttribute(srcAttr), context);
+}
+
 }
 
 #endif
index 4697e02..9465642 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(VIDEO_TRACK)
 
 #include "HTMLElement.h"
+#include "LoadableTextTrack.h"
 
 namespace WebCore {
 
@@ -47,13 +48,18 @@ public:
     void setSrclang(const String&);
     void setLabel(const String&);
     void setIsDefault(bool);
+    
+    void load(ScriptExecutionContext*);
 
 private:
     HTMLTrackElement(const QualifiedName&, Document*);
+    virtual ~HTMLTrackElement();
 
     virtual void insertedIntoTree(bool);
     virtual void willRemove();
     virtual bool isURLAttribute(Attribute*) const;
+    
+    RefPtr<LoadableTextTrack> m_track;
 };
 
 }
index db9daa1..4eb2485 100644 (file)
 namespace WebCore {
 
 LoadableTextTrack::LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault)
+    : TextTrack(kind, label, language)
+    , m_isDefault(isDefault)
 {
-    // FIXME(62881): Implement.
-    m_private = LoadableTextTrackImpl::create(kind, label, language, isDefault);
 }
 
 LoadableTextTrack::~LoadableTextTrack()
 {
-    // FIXME(62881): Implement.
 }
 
-void LoadableTextTrack::load(const String&)
+void LoadableTextTrack::load(const String& url, ScriptExecutionContext* context)
 {
-    // FIXME(62881): Implement.
+    return m_parser.load(url, context, this);
+}
+
+bool LoadableTextTrack::supportsType(const String& url)
+{
+    return m_parser.supportsType(url);
+}
+
+void LoadableTextTrack::newCuesParsed()
+{
+    // FIXME(62883): Fetch new cues from parser and temporarily store to give to CueLoaderClient when fetchNewCuesFromLoader is called.
+}
+
+void LoadableTextTrack::trackLoadStarted()
+{
+    setReadyState(TextTrack::LOADING);
+}
+
+void LoadableTextTrack::trackLoadError()
+{
+    setReadyState(TextTrack::ERROR);
+}
+
+void LoadableTextTrack::trackLoadCompleted()
+{
+    setReadyState(TextTrack::LOADED);
+}
+
+void LoadableTextTrack::newCuesLoaded()
+{
+    // FIXME(62885): Tell the client to fetch the latest cues.
+}
+
+void LoadableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&)
+{
+    // FIXME(62885): Implement.
 }
 
 } // namespace WebCore
index b712962..c55ed26 100644 (file)
 
 #if ENABLE(VIDEO_TRACK)
 
-#include "LoadableTextTrackImpl.h"
-#include "PassRefPtr.h"
+#include "CueLoader.h"
+#include "CueParser.h"
 #include "TextTrack.h"
 #include "TextTrackCueList.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
-class LoadableTextTrack : public TextTrack {
+class ScriptExecutionContext;
+class TextTrack;
+class TextTrackCue;
+
+class LoadableTextTrack : public TextTrack, public CueParserClient, public CueLoader {
 public:
     static PassRefPtr<LoadableTextTrack> create(const String& kind, const String& label, const String& language, bool isDefault)
     {
@@ -43,11 +49,23 @@ public:
     }
     virtual ~LoadableTextTrack();
 
-    void load(const String&);
+    void load(const String&, ScriptExecutionContext*);
+    bool supportsType(const String&);
+
+    virtual void newCuesParsed();
+    virtual void trackLoadStarted();
+    virtual void trackLoadError();
+    virtual void trackLoadCompleted();
+
+    virtual void newCuesLoaded();
+    virtual void fetchNewestCues(Vector<TextTrackCue*>&);
 
 private:
     LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault);
 
+    CueParser m_parser;
+
+    bool m_isDefault;
 };
 } // namespace WebCore
 
diff --git a/Source/WebCore/html/LoadableTextTrackImpl.cpp b/Source/WebCore/html/LoadableTextTrackImpl.cpp
deleted file mode 100644 (file)
index 1ffc69d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(VIDEO_TRACK)
-
-#include "LoadableTextTrackImpl.h"
-
-#include "TextTrackCueList.h"
-
-namespace WebCore {
-
-LoadableTextTrackImpl::LoadableTextTrackImpl(const String& kind, const String& label, const String& language, bool isDefault)
-    : TextTrackPrivateInterface(kind, label, language)
-    , m_isDefault(isDefault)
-{
-}
-
-LoadableTextTrackImpl::~LoadableTextTrackImpl()
-{
-}
-
-PassRefPtr<TextTrackCueList> LoadableTextTrackImpl::cues() const
-{
-    // FIXME(62885): Implement.
-    return 0;
-}
-
-PassRefPtr<TextTrackCueList> LoadableTextTrackImpl::activeCues() const
-{
-    // FIXME(62885): Implement.
-    return 0;
-}
-
-void LoadableTextTrackImpl::fetchNewestCues(Vector<TextTrackCue*>&)
-{
-    // FIXME(62885): Implement.
-}
-
-void LoadableTextTrackImpl::load(const String&)
-{
-    // FIXME(62881): Implement.
-}
-
-void LoadableTextTrackImpl::newCuesLoaded()
-{
-    // FIXME(62881): Implement.
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/html/LoadableTextTrackImpl.h b/Source/WebCore/html/LoadableTextTrackImpl.h
deleted file mode 100644 (file)
index ea81674..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LoadableTextTrackImpl_h
-#define LoadableTextTrackImpl_h
-
-#if ENABLE(VIDEO_TRACK)
-
-#include "CueLoader.h"
-#include "CueParser.h"
-#include "TextTrackPrivate.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class TextTrack;
-class TextTrackCue;
-class TextTrackCueList;
-
-class LoadableTextTrackImpl : public TextTrackPrivateInterface, public CueLoader {
-public:
-    static PassOwnPtr<LoadableTextTrackImpl> create(const String& kind, const String& label, const String& language, bool isDefault)
-    {
-        return adoptPtr(new LoadableTextTrackImpl(kind, label, language, isDefault));
-    }
-    virtual ~LoadableTextTrackImpl();
-
-    // TextTrackPrivateInterface methods
-    virtual PassRefPtr<TextTrackCueList> cues() const;
-    virtual PassRefPtr<TextTrackCueList> activeCues() const;
-    virtual void load(const String&);
-
-    // CueLoader interface
-    virtual void newCuesLoaded();
-    virtual void fetchNewestCues(Vector<TextTrackCue*>&);
-
-private:
-    LoadableTextTrackImpl(const String& kind, const String& label, const String& language, bool isDefault);
-
-    bool m_isDefault;
-
-    CueParser m_parser;
-    RefPtr<TextTrackCueList> m_cues;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
index 4032e4b..4d68354 100644 (file)
 
 #include "MutableTextTrack.h"
 
-#include "MutableTextTrackImpl.h"
+#include "TextTrack.h"
+#include "TextTrackCue.h"
 
 namespace WebCore {
 
 MutableTextTrack::MutableTextTrack(const String& kind, const String& label, const String& language)
+    : TextTrack(kind, label, language)
 {
-    m_private = MutableTextTrackImpl::create(kind, label, language);
 }
 
 void MutableTextTrack::addCue(PassRefPtr<TextTrackCue>)
@@ -48,6 +49,16 @@ void MutableTextTrack::removeCue(PassRefPtr<TextTrackCue>)
     // FIXME(62890): Implement.
 }
 
+void MutableTextTrack::newCuesLoaded()
+{
+    // FIXME(62890): Implement.
+}
+
+void MutableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&)
+{
+    // FIXME(62890): Implement.
+}
+
 } // namespace WebCore
 
 #endif
index 8333cc9..618c272 100644 (file)
 
 #if ENABLE(VIDEO_TRACK)
 
+#include "CueLoader.h"
 #include "TextTrack.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
 class TextTrackCue;
 
-class MutableTextTrack : public TextTrack {
+class MutableTextTrack : public TextTrack, public CueLoader {
 public:
     static PassRefPtr<MutableTextTrack> create(const String& kind, const String& label, const String& language)
     {
@@ -44,6 +47,10 @@ public:
 
     void addCue(PassRefPtr<TextTrackCue>);
     void removeCue(PassRefPtr<TextTrackCue>);
+
+    virtual void newCuesLoaded();
+    virtual void fetchNewestCues(Vector<TextTrackCue*>&);
+
 private:
     MutableTextTrack(const String& kind, const String& label, const String& language);
 };
diff --git a/Source/WebCore/html/MutableTextTrackImpl.cpp b/Source/WebCore/html/MutableTextTrackImpl.cpp
deleted file mode 100644 (file)
index c0870b1..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(VIDEO_TRACK)
-
-#include "MutableTextTrackImpl.h"
-
-#include "TextTrack.h"
-#include "TextTrackCue.h"
-#include "TextTrackCueList.h"
-
-namespace WebCore {
-
-MutableTextTrackImpl::MutableTextTrackImpl(const String& kind, const String& label, const String& language)
-    : TextTrackPrivateInterface(kind, label, language)
-{
-}
-
-MutableTextTrackImpl::~MutableTextTrackImpl()
-{
-}
-
-void MutableTextTrackImpl::addCue(TextTrackCue*)
-{
-    // FIXME(62890): Implement.
-}
-
-void MutableTextTrackImpl::removeCue(TextTrackCue*)
-{
-    // FIXME(62890): Implement.
-}
-
-PassRefPtr<TextTrackCueList> MutableTextTrackImpl::cues() const
-{
-    // FIXME(62885): Implement.
-    return 0;
-}
-
-PassRefPtr<TextTrackCueList> MutableTextTrackImpl::activeCues() const
-{
-    // FIXME(62885): Implement.
-    return 0;
-}
-
-void MutableTextTrackImpl::newCuesLoaded()
-{
-    // FIXME(62890): Implement.
-}
-
-void MutableTextTrackImpl::fetchNewestCues(Vector<TextTrackCue*>&)
-{
-    // FIXME(62890): Implement.
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/html/MutableTextTrackImpl.h b/Source/WebCore/html/MutableTextTrackImpl.h
deleted file mode 100644 (file)
index 759854c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MutableTextTrackImpl_h
-#define MutableTextTrackImpl_h
-
-#if ENABLE(VIDEO_TRACK)
-
-#include "CueLoader.h"
-#include "TextTrackPrivate.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class CueLoaderClient;
-class TextTrack;
-class TextTrackCue;
-class TextTrackCueList;
-
-class MutableTextTrackImpl : public TextTrackPrivateInterface, public CueLoader {
-public:
-    static PassOwnPtr<MutableTextTrackImpl> create(const String& kind, const String& label, const String& language)
-    {
-        return adoptPtr(new MutableTextTrackImpl(kind, label, language));
-    }
-    virtual ~MutableTextTrackImpl();
-
-    // TextTrackPrivateInterface methods
-    virtual PassRefPtr<TextTrackCueList> cues() const;
-    virtual PassRefPtr<TextTrackCueList> activeCues() const;
-    virtual void addCue(TextTrackCue*);
-    virtual void removeCue(TextTrackCue*);
-
-    // CueLoader interface
-    virtual void newCuesLoaded();
-    virtual void fetchNewestCues(Vector<TextTrackCue*>&);
-
-private:
-    MutableTextTrackImpl(const String& kind, const String& label, const String& language);
-
-    RefPtr<TextTrackCueList> m_cues;
-    Vector<TextTrackCue*> m_newestCues;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
index 633e58d..cb0b046 100644 (file)
 #include "TextTrack.h"
 
 #include "TextTrackCueList.h"
-#include "TextTrackPrivate.h"
 
 namespace WebCore {
 
-class NullTextTrackPrivate : public TextTrackPrivateInterface {
-public:
-    NullTextTrackPrivate();
-    virtual ~NullTextTrackPrivate();
-
-    // TextTrackPrivateInterface methods
-    virtual String kind() const { return emptyString(); }
-    virtual String label() const { return emptyString(); }
-    virtual String language() const { return emptyString(); }
-    virtual TextTrack::ReadyState readyState() const { return TextTrack::NONE; }
-    virtual TextTrack::Mode mode() const { return TextTrack::OFF; }
-    virtual void setMode(TextTrack::Mode) { }
-    virtual PassRefPtr<TextTrackCueList> cues() const { return 0; }
-    virtual PassRefPtr<TextTrackCueList> activeCues() const { return 0; }
-    virtual void load(const String&) { }
-};
-
-static PassOwnPtr<NullTextTrackPrivate> createNullTextTrackPrivate()
-{
-    return adoptPtr(new NullTextTrackPrivate());
-}
-
-TextTrack::TextTrack()
-    : m_private(createNullTextTrackPrivate())
+TextTrack::TextTrack(const String& kind, const String& label, const String& language)
+    : m_kind(kind)
+    , m_label(label)
+    , m_language(language)
+    , m_readyState(TextTrack::NONE)
+    , m_mode(TextTrack::SHOWING)
 {
 }
 
@@ -72,27 +53,32 @@ TextTrack::~TextTrack()
 
 String TextTrack::kind() const
 {
-    return m_private->kind();
+    return m_kind;
 }
 
 String TextTrack::label() const
 {
-    return m_private->label();
+    return m_label;
 }
 
 String TextTrack::language() const
 {
-    return m_private->language();
+    return m_language;
 }
 
 TextTrack::ReadyState TextTrack::readyState() const
 {
-    return m_private->readyState();
+    return m_readyState;
+}
+
+void TextTrack::setReadyState(ReadyState state)
+{
+    m_readyState = state;
 }
 
 TextTrack::Mode TextTrack::mode() const
 {
-    return m_private->mode();
+    return m_mode;
 }
 
 void TextTrack::setMode(unsigned short mode, ExceptionCode& ec)
@@ -100,19 +86,21 @@ void TextTrack::setMode(unsigned short mode, ExceptionCode& ec)
     // 4.8.10.12.5 On setting the mode, if the new value is not either 0, 1, or 2,
     // the user agent must throw an INVALID_ACCESS_ERR exception.
     if (mode == TextTrack::OFF || mode == TextTrack::HIDDEN || mode == TextTrack::SHOWING)
-        m_private->setMode(static_cast<Mode>(mode));
+        m_mode = static_cast<Mode>(mode);
     else
         ec = INVALID_ACCESS_ERR;
 }
 
 PassRefPtr<TextTrackCueList> TextTrack::cues() const
 {
-    return m_private->cues();
+    // FIXME(62885): Implement.
+    return 0;
 }
 
 PassRefPtr<TextTrackCueList> TextTrack::activeCues() const
 {
-    return m_private->activeCues();
+    // FIXME(62885): Implement.
+    return 0;
 }
 
 } // namespace WebCore
index e4ea107..9a82f83 100644 (file)
@@ -37,7 +37,6 @@ namespace WebCore {
 
 class TextTrack;
 class TextTrackCueList;
-class TextTrackPrivateInterface;
 
 class TextTrackClient {
 public:
@@ -49,9 +48,9 @@ public:
 
 class TextTrack : public RefCounted<TextTrack> {
 public:
-    static PassRefPtr<TextTrack> create()
+    static PassRefPtr<TextTrack> create(const String& kind, const String& label, const String& language)
     {
-        return adoptRef(new TextTrack);
+        return adoptRef(new TextTrack(kind, label, language));
     }
     virtual ~TextTrack();
 
@@ -73,8 +72,18 @@ public:
     void modeChanged();
 
 protected:
-    TextTrack();
-    OwnPtr<TextTrackPrivateInterface> m_private;
+    TextTrack(const String& kind, const String& label, const String& language);
+
+    void setReadyState(ReadyState);
+
+    RefPtr<TextTrackCueList> m_cues;
+
+private:
+    String m_kind;
+    String m_label;
+    String m_language;
+    TextTrack::ReadyState m_readyState;
+    TextTrack::Mode m_mode;
 
 };
 
diff --git a/Source/WebCore/html/TextTrackPrivate.h b/Source/WebCore/html/TextTrackPrivate.h
deleted file mode 100644 (file)
index 2ccc7af..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TextTrackPrivate_h
-#define TextTrackPrivate_h
-
-#if ENABLE(VIDEO_TRACK)
-
-#include "TextTrack.h"
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-
-namespace WebCore {
-
-class CueLoaderClient;
-class TextTrackCueList;
-
-class TextTrackPrivateInterface {
-    WTF_MAKE_NONCOPYABLE(TextTrackPrivateInterface); WTF_MAKE_FAST_ALLOCATED;
-public:
-    TextTrackPrivateInterface(const String& kind, const String& label, const String& language)
-        : m_kind(kind)
-        , m_label(label)
-        , m_language(language)
-        , m_readyState(TextTrack::NONE)
-        , m_mode(TextTrack::SHOWING)
-    {
-    }
-    virtual ~TextTrackPrivateInterface() { }
-
-    virtual String kind() const { return m_kind; }
-    virtual String label() const { return m_label; }
-    virtual String language() const { return m_language; }
-
-    virtual TextTrack::ReadyState readyState() const { return m_readyState; }
-
-    virtual TextTrack::Mode mode() const { return m_mode; }
-    virtual void setMode(TextTrack::Mode mode) { m_mode = mode; }
-
-    virtual PassRefPtr<TextTrackCueList> cues() const = 0;
-    virtual PassRefPtr<TextTrackCueList> activeCues() const = 0;
-
-    // This method should only be overridden by tracks that load cue data from a URL.
-    virtual void load(const String&) { }
-
-private:
-    String m_kind;
-    String m_label;
-    String m_language;
-    TextTrack::ReadyState m_readyState;
-    TextTrack::Mode m_mode;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
index 066a1ea..3b353e7 100644 (file)
@@ -34,6 +34,9 @@
 
 #include "CueParser.h"
 
+#include "ResourceRequest.h"
+#include "ThreadableLoader.h"
+
 namespace WebCore {
 
 CueParser::CueParser()
@@ -43,19 +46,52 @@ CueParser::CueParser()
 
 CueParser::~CueParser()
 {
+    if (m_loader)
+        m_loader->cancel();
+    m_loader = 0;
+}
+
+void CueParser::load(const String& url, ScriptExecutionContext* context, CueParserClient* client)
+{
+    ResourceRequest request(url);
+
+    ThreadableLoaderOptions options;
+    options.sendLoadCallbacks = true;
+    options.crossOriginRequestPolicy = AllowCrossOriginRequests;
+
+    m_client = client;
+
+    m_loader = ThreadableLoader::create(context, this, request, options);
+}
+
+bool CueParser::supportsType(const String& url)
+{
+    // FIXME(62893): check against a list of supported types
+    return false;
+}
+
+void CueParser::didReceiveResponse(unsigned long /*identifier*/, const ResourceResponse&)
+{
+    // FIXME(62893): Create m_private based on MIME type.
+    m_client->trackLoadStarted();
+}
+
+void CueParser::didReceiveData(const char* data, int len)
+{
+    // FIXME(62893): Send data along to m_private parser to be parsed.
 }
 
-void CueParser::load(const String&)
+void CueParser::didFinishLoading(unsigned long)
 {
-    // FIXME(62881): Implement.
+    m_client->trackLoadCompleted();
 }
 
-void CueParser::didReceiveData(const char*, int)
+void CueParser::didFail(const ResourceError&)
 {
-    // FIXME(62881): Implement.
+    m_client->trackLoadError();
 }
 
-void CueParser::fetchParsedCues(Vector<PassRefPtr<TextTrackCue> >&)
+void CueParser::fetchParsedCues(Vector<RefPtr<TextTrackCue> >&)
 {
     // FIXME(62893): Implement.
 }
index 77a79f4..744cc32 100644 (file)
 
 namespace WebCore {
 
+class ScriptExecutionContext;
 class TextTrackCue;
 
+class CueParserClient {
+public:
+    virtual void newCuesParsed() = 0;
+    virtual void trackLoadStarted() = 0;
+    virtual void trackLoadError() = 0;
+    virtual void trackLoadCompleted() = 0;
+};
+
 class CueParser : public ThreadableLoaderClient {
 public:
     CueParser();
     virtual ~CueParser();
 
-    // ThreadableLoaderClient methods.
+    void didReceiveResponse(unsigned long, const ResourceResponse&);
     void didReceiveData(const char*, int);
+    void didFinishLoading(unsigned long);
+    void didFail(const ResourceError&);
+
+    void load(const String&, ScriptExecutionContext*, CueParserClient*);
+    bool supportsType(const String&);
 
-    void load(const String&);
-    void fetchParsedCues(Vector<PassRefPtr<TextTrackCue> >&);
+    void fetchParsedCues(Vector<RefPtr<TextTrackCue> >&);
 
 private:
     RefPtr<ThreadableLoader> m_loader;
     OwnPtr<CueParserPrivateInterface> m_private;
+    CueParserClient* m_client;
 };
 
 } // namespace WebCore