Changeset 89711 in webkit


Ignore:
Timestamp:
Jun 24, 2011 4:06:01 PM (13 years ago)
Author:
hclam@chromium.org
Message:

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:
Location:
trunk/Source/WebCore
Files:
5 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r89690 r89711  
    19781978        html/HTMLTrackElement.cpp
    19791979        html/LoadableTextTrack.cpp
    1980         html/LoadableTextTrackImpl.cpp
    19811980        html/MutableTextTrack.cpp
    1982         html/MutableTextTrackImpl.cpp
    19831981        html/TextTrack.cpp
    19841982        html/TextTrackCue.cpp
  • trunk/Source/WebCore/ChangeLog

    r89710 r89711  
     12011-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
    1392011-06-24  Rob Buis  <rbuis@rim.com>
    240
  • trunk/Source/WebCore/GNUmakefile.am

    r89442 r89711  
    6464        -I$(srcdir)/Source/WebCore/platform/text \
    6565        -I$(srcdir)/Source/WebCore/platform/text/transcoder \
     66        -I$(srcdir)/Source/WebCore/platform/track \
    6667        -I$(srcdir)/Source/WebCore/platform/win \
    6768        -I$(srcdir)/Source/WebCore/plugins \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r89690 r89711  
    15971597        Source/WebCore/html/ColorInputType.cpp \
    15981598        Source/WebCore/html/ColorInputType.h \
     1599        Source/WebCore/html/CueIndex.cpp \
     1600        Source/WebCore/html/CueIndex.h \
    15991601        Source/WebCore/html/DateInputType.cpp \
    16001602        Source/WebCore/html/DateInputType.h \
     
    18061808        Source/WebCore/html/LinkRelAttribute.cpp \
    18071809        Source/WebCore/html/LinkRelAttribute.h \
     1810        Source/WebCore/html/LoadableTextTrack.cpp \
     1811        Source/WebCore/html/LoadableTextTrack.h \
    18081812        Source/WebCore/html/MediaDocument.cpp \
    18091813        Source/WebCore/html/MediaDocument.h \
     
    18111815        Source/WebCore/html/MonthInputType.cpp \
    18121816        Source/WebCore/html/MonthInputType.h \
     1817        Source/WebCore/html/MutableTextTrack.cpp \
     1818        Source/WebCore/html/MutableTextTrack.h \
    18131819        Source/WebCore/html/NumberInputType.cpp \
    18141820        Source/WebCore/html/NumberInputType.h \
     
    18991905        Source/WebCore/html/TextInputType.h \
    19001906        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 \
    19011913        Source/WebCore/html/TimeInputType.cpp \
    19021914        Source/WebCore/html/TimeInputType.h \
     
    20792091        Source/WebCore/loader/CrossOriginPreflightResultCache.cpp \
    20802092        Source/WebCore/loader/CrossOriginPreflightResultCache.h \
     2093        Source/WebCore/loader/CueLoader.cpp \
     2094        Source/WebCore/loader/CueLoader.h \
    20812095        Source/WebCore/loader/DocumentLoader.cpp \
    20822096        Source/WebCore/loader/DocumentLoader.h \
     
    28262840        Source/WebCore/platform/Timer.cpp \
    28272841        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 \
    28282845        Source/WebCore/platform/TreeShared.h \
    28292846        Source/WebCore/platform/URLString.h \
  • trunk/Source/WebCore/WebCore.gypi

    r89700 r89711  
    30483048            'html/LoadableTextTrack.cpp',
    30493049            'html/LoadableTextTrack.h',
    3050             'html/LoadableTextTrackImpl.cpp',
    3051             'html/LoadableTextTrackImpl.h',
    30523050            'html/MediaDocument.cpp',
    30533051            'html/MediaDocument.h',
     
    30553053            'html/MutableTextTrack.cpp',
    30563054            'html/MutableTextTrack.h',
    3057             'html/MutableTextTrackImpl.cpp',
    3058             'html/MutableTextTrackImpl.h',
    30593055            'html/MonthInputType.cpp',
    30603056            'html/MonthInputType.h',
     
    30923088            'html/TextTrackCueList.cpp',
    30933089            'html/TextTrackCueList.h',
    3094             'html/TextTrackPrivateInterface.h',
    30953090            'html/TimeInputType.cpp',
    30963091            'html/TimeInputType.h',
  • trunk/Source/WebCore/WebCore.pro

    r89690 r89711  
    17371737    html/LinkRelAttribute.h \
    17381738    html/LoadableTextTrack.h \
    1739     html/LoadableTextTrackImpl.h \
    17401739    html/MediaDocument.h \
    17411740    html/MutableTextTrack.h \
    1742     html/MutableTextTrackImpl.h \
    17431741    html/PluginDocument.h \
    17441742    html/StepRange.h \
     
    17471745    html/TextTrackCue.h \
    17481746    html/TextTrackCueList.h \
    1749     html/TextTrackPrivate.h \
    17501747    html/TimeRanges.h \
    17511748    html/ValidityState.h \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r89690 r89711  
    40264026                B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */; };
    40274027                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 */; };
    40304028                B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */; };
    40314029                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 */; };
    40344030                B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */; };
    40354031                B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5613A12A0B00846B27 /* TextTrack.h */; };
     
    40384034                B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */; };
    40394035                B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */; };
    4040                 B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */; };
    40414036                B1AD4E7313A12A4600846B27 /* CueLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1AD4E7113A12A4600846B27 /* CueLoader.cpp */; };
    40424037                B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B1AD4E7213A12A4600846B27 /* CueLoader.h */; };
     
    1046410459                B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoadableTextTrack.cpp; path = html/LoadableTextTrack.cpp; sourceTree = SOURCE_ROOT; };
    1046510460                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; };
    1046810461                B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableTextTrack.cpp; path = html/MutableTextTrack.cpp; sourceTree = SOURCE_ROOT; };
    1046910462                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; };
    1047210463                B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrack.cpp; path = html/TextTrack.cpp; sourceTree = SOURCE_ROOT; };
    1047310464                B1AD4E5613A12A0B00846B27 /* TextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrack.h; path = html/TextTrack.h; sourceTree = SOURCE_ROOT; };
     
    1047610467                B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrackCueList.cpp; path = html/TextTrackCueList.cpp; sourceTree = SOURCE_ROOT; };
    1047710468                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; };
    1047910469                B1AD4E7113A12A4600846B27 /* CueLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CueLoader.cpp; path = loader/CueLoader.cpp; sourceTree = SOURCE_ROOT; };
    1048010470                B1AD4E7213A12A4600846B27 /* CueLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CueLoader.h; path = loader/CueLoader.h; sourceTree = SOURCE_ROOT; };
     
    1365713647                                B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */,
    1365813648                                B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */,
    13659                                 B1AD4E4F13A12A0B00846B27 /* LoadableTextTrackImpl.cpp */,
    13660                                 B1AD4E5013A12A0B00846B27 /* LoadableTextTrackImpl.h */,
    1366113649                                B1AD4E5113A12A0B00846B27 /* MutableTextTrack.cpp */,
    1366213650                                B1AD4E5213A12A0B00846B27 /* MutableTextTrack.h */,
    13663                                 B1AD4E5313A12A0B00846B27 /* MutableTextTrackImpl.cpp */,
    13664                                 B1AD4E5413A12A0B00846B27 /* MutableTextTrackImpl.h */,
    1366513651                                B1AD4E5513A12A0B00846B27 /* TextTrack.cpp */,
    1366613652                                B1AD4E5613A12A0B00846B27 /* TextTrack.h */,
     
    1366913655                                B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */,
    1367013656                                B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */,
    13671                                 B1AD4E5B13A12A0B00846B27 /* TextTrackPrivate.h */,
    1367213657                                41815C1B138319630057AAA4 /* js */,
    1367313658                                417DA4CF13734326007C57FB /* Internals.cpp */,
     
    2305823043                                B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */,
    2305923044                                B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */,
    23060                                 B1AD4E6113A12A0B00846B27 /* LoadableTextTrackImpl.h in Headers */,
    2306123045                                B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */,
    23062                                 B1AD4E6513A12A0B00846B27 /* MutableTextTrackImpl.h in Headers */,
    2306323046                                B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */,
    2306423047                                B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */,
    2306523048                                B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */,
    23066                                 B1AD4E6C13A12A0B00846B27 /* TextTrackPrivate.h in Headers */,
    2306723049                                B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */,
    2306823050                                B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */,
     
    2581925801                                B1AD4E5C13A12A0B00846B27 /* CueIndex.cpp in Sources */,
    2582025802                                B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */,
    25821                                 B1AD4E6013A12A0B00846B27 /* LoadableTextTrackImpl.cpp in Sources */,
    2582225803                                B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */,
    25823                                 B1AD4E6413A12A0B00846B27 /* MutableTextTrackImpl.cpp in Sources */,
    2582425804                                B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */,
    2582525805                                B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */,
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r89172 r89711  
    8383#include "RenderEmbeddedObject.h"
    8484#include "Widget.h"
     85#endif
     86
     87#if ENABLE(VIDEO_TRACK)
     88#include "HTMLTrackElement.h"
    8589#endif
    8690
     
    591595
    592596    selectMediaResource();
     597#if ENABLE(VIDEO_TRACK)
     598    loadTextTracks();
     599#endif
    593600}
    594601
     
    766773        renderer()->updateFromElement();
    767774}
     775
     776#if ENABLE(VIDEO_TRACK)
     777void 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
    768787
    769788bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidSourceAction actionIfInvalid)
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r89044 r89711  
    301301    void mediaLoadingFailed(MediaPlayer::NetworkState);
    302302
     303#if ENABLE(VIDEO_TRACK)
     304    void loadTextTracks();
     305#endif
     306
    303307    // These "internal" functions do not check user gesture restrictions.
    304308    void loadInternal();
  • trunk/Source/WebCore/html/HTMLTrackElement.cpp

    r83952 r89711  
    4444    LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
    4545    ASSERT(hasTagName(trackTag));
     46}
     47
     48HTMLTrackElement::~HTMLTrackElement()
     49{
    4650}
    4751
     
    124128}
    125129
     130void 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
    126138}
    127139
  • trunk/Source/WebCore/html/HTMLTrackElement.h

    r83952 r89711  
    3030
    3131#include "HTMLElement.h"
     32#include "LoadableTextTrack.h"
    3233
    3334namespace WebCore {
     
    4849    void setLabel(const String&);
    4950    void setIsDefault(bool);
     51   
     52    void load(ScriptExecutionContext*);
    5053
    5154private:
    5255    HTMLTrackElement(const QualifiedName&, Document*);
     56    virtual ~HTMLTrackElement();
    5357
    5458    virtual void insertedIntoTree(bool);
    5559    virtual void willRemove();
    5660    virtual bool isURLAttribute(Attribute*) const;
     61   
     62    RefPtr<LoadableTextTrack> m_track;
    5763};
    5864
  • trunk/Source/WebCore/html/LoadableTextTrack.cpp

    r89186 r89711  
    3333
    3434LoadableTextTrack::LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault)
     35    : TextTrack(kind, label, language)
     36    , m_isDefault(isDefault)
    3537{
    36     // FIXME(62881): Implement.
    37     m_private = LoadableTextTrackImpl::create(kind, label, language, isDefault);
    3838}
    3939
    4040LoadableTextTrack::~LoadableTextTrack()
    4141{
    42     // FIXME(62881): Implement.
    4342}
    4443
    45 void LoadableTextTrack::load(const String&)
     44void LoadableTextTrack::load(const String& url, ScriptExecutionContext* context)
    4645{
    47     // FIXME(62881): Implement.
     46    return m_parser.load(url, context, this);
     47}
     48
     49bool LoadableTextTrack::supportsType(const String& url)
     50{
     51    return m_parser.supportsType(url);
     52}
     53
     54void LoadableTextTrack::newCuesParsed()
     55{
     56    // FIXME(62883): Fetch new cues from parser and temporarily store to give to CueLoaderClient when fetchNewCuesFromLoader is called.
     57}
     58
     59void LoadableTextTrack::trackLoadStarted()
     60{
     61    setReadyState(TextTrack::LOADING);
     62}
     63
     64void LoadableTextTrack::trackLoadError()
     65{
     66    setReadyState(TextTrack::ERROR);
     67}
     68
     69void LoadableTextTrack::trackLoadCompleted()
     70{
     71    setReadyState(TextTrack::LOADED);
     72}
     73
     74void LoadableTextTrack::newCuesLoaded()
     75{
     76    // FIXME(62885): Tell the client to fetch the latest cues.
     77}
     78
     79void LoadableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&)
     80{
     81    // FIXME(62885): Implement.
    4882}
    4983
  • trunk/Source/WebCore/html/LoadableTextTrack.h

    r89186 r89711  
    2929#if ENABLE(VIDEO_TRACK)
    3030
    31 #include "LoadableTextTrackImpl.h"
    32 #include "PassRefPtr.h"
     31#include "CueLoader.h"
     32#include "CueParser.h"
    3333#include "TextTrack.h"
    3434#include "TextTrackCueList.h"
     35#include <wtf/PassRefPtr.h>
     36#include <wtf/Vector.h>
    3537
    3638namespace WebCore {
    3739
    38 class LoadableTextTrack : public TextTrack {
     40class ScriptExecutionContext;
     41class TextTrack;
     42class TextTrackCue;
     43
     44class LoadableTextTrack : public TextTrack, public CueParserClient, public CueLoader {
    3945public:
    4046    static PassRefPtr<LoadableTextTrack> create(const String& kind, const String& label, const String& language, bool isDefault)
     
    4450    virtual ~LoadableTextTrack();
    4551
    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*>&);
    4762
    4863private:
    4964    LoadableTextTrack(const String& kind, const String& label, const String& language, bool isDefault);
    5065
     66    CueParser m_parser;
     67
     68    bool m_isDefault;
    5169};
    5270} // namespace WebCore
  • trunk/Source/WebCore/html/MutableTextTrack.cpp

    r89186 r89711  
    3030#include "MutableTextTrack.h"
    3131
    32 #include "MutableTextTrackImpl.h"
     32#include "TextTrack.h"
     33#include "TextTrackCue.h"
    3334
    3435namespace WebCore {
    3536
    3637MutableTextTrack::MutableTextTrack(const String& kind, const String& label, const String& language)
     38    : TextTrack(kind, label, language)
    3739{
    38     m_private = MutableTextTrackImpl::create(kind, label, language);
    3940}
    4041
     
    4950}
    5051
     52void MutableTextTrack::newCuesLoaded()
     53{
     54    // FIXME(62890): Implement.
     55}
     56
     57void MutableTextTrack::fetchNewestCues(Vector<TextTrackCue*>&)
     58{
     59    // FIXME(62890): Implement.
     60}
     61
    5162} // namespace WebCore
    5263
  • trunk/Source/WebCore/html/MutableTextTrack.h

    r89186 r89711  
    2929#if ENABLE(VIDEO_TRACK)
    3030
     31#include "CueLoader.h"
    3132#include "TextTrack.h"
     33#include <wtf/PassRefPtr.h>
     34#include <wtf/Vector.h>
    3235
    3336namespace WebCore {
     
    3538class TextTrackCue;
    3639
    37 class MutableTextTrack : public TextTrack {
     40class MutableTextTrack : public TextTrack, public CueLoader {
    3841public:
    3942    static PassRefPtr<MutableTextTrack> create(const String& kind, const String& label, const String& language)
     
    4548    void addCue(PassRefPtr<TextTrackCue>);
    4649    void removeCue(PassRefPtr<TextTrackCue>);
     50
     51    virtual void newCuesLoaded();
     52    virtual void fetchNewestCues(Vector<TextTrackCue*>&);
     53
    4754private:
    4855    MutableTextTrack(const String& kind, const String& label, const String& language);
  • trunk/Source/WebCore/html/TextTrack.cpp

    r89186 r89711  
    3636
    3737#include "TextTrackCueList.h"
    38 #include "TextTrackPrivate.h"
    3938
    4039namespace WebCore {
    4140
    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())
     41TextTrack::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)
    6647{
    6748}
     
    7354String TextTrack::kind() const
    7455{
    75     return m_private->kind();
     56    return m_kind;
    7657}
    7758
    7859String TextTrack::label() const
    7960{
    80     return m_private->label();
     61    return m_label;
    8162}
    8263
    8364String TextTrack::language() const
    8465{
    85     return m_private->language();
     66    return m_language;
    8667}
    8768
    8869TextTrack::ReadyState TextTrack::readyState() const
    8970{
    90     return m_private->readyState();
     71    return m_readyState;
     72}
     73
     74void TextTrack::setReadyState(ReadyState state)
     75{
     76    m_readyState = state;
    9177}
    9278
    9379TextTrack::Mode TextTrack::mode() const
    9480{
    95     return m_private->mode();
     81    return m_mode;
    9682}
    9783
     
    10187    // the user agent must throw an INVALID_ACCESS_ERR exception.
    10288    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);
    10490    else
    10591        ec = INVALID_ACCESS_ERR;
     
    10894PassRefPtr<TextTrackCueList> TextTrack::cues() const
    10995{
    110     return m_private->cues();
     96    // FIXME(62885): Implement.
     97    return 0;
    11198}
    11299
    113100PassRefPtr<TextTrackCueList> TextTrack::activeCues() const
    114101{
    115     return m_private->activeCues();
     102    // FIXME(62885): Implement.
     103    return 0;
    116104}
    117105
  • trunk/Source/WebCore/html/TextTrack.h

    r89186 r89711  
    3838class TextTrack;
    3939class TextTrackCueList;
    40 class TextTrackPrivateInterface;
    4140
    4241class TextTrackClient {
     
    5049class TextTrack : public RefCounted<TextTrack> {
    5150public:
    52     static PassRefPtr<TextTrack> create()
     51    static PassRefPtr<TextTrack> create(const String& kind, const String& label, const String& language)
    5352    {
    54         return adoptRef(new TextTrack);
     53        return adoptRef(new TextTrack(kind, label, language));
    5554    }
    5655    virtual ~TextTrack();
     
    7473
    7574protected:
    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
     81private:
     82    String m_kind;
     83    String m_label;
     84    String m_language;
     85    TextTrack::ReadyState m_readyState;
     86    TextTrack::Mode m_mode;
    7887
    7988};
  • trunk/Source/WebCore/platform/track/CueParser.cpp

    r89186 r89711  
    3535#include "CueParser.h"
    3636
     37#include "ResourceRequest.h"
     38#include "ThreadableLoader.h"
     39
    3740namespace WebCore {
    3841
     
    4447CueParser::~CueParser()
    4548{
     49    if (m_loader)
     50        m_loader->cancel();
     51    m_loader = 0;
    4652}
    4753
    48 void CueParser::load(const String&)
     54void CueParser::load(const String& url, ScriptExecutionContext* context, CueParserClient* client)
    4955{
    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);
    5165}
    5266
    53 void CueParser::didReceiveData(const char*, int)
     67bool CueParser::supportsType(const String& url)
    5468{
    55     // FIXME(62881): Implement.
     69    // FIXME(62893): check against a list of supported types
     70    return false;
    5671}
    5772
    58 void CueParser::fetchParsedCues(Vector<PassRefPtr<TextTrackCue> >&)
     73void CueParser::didReceiveResponse(unsigned long /*identifier*/, const ResourceResponse&)
     74{
     75    // FIXME(62893): Create m_private based on MIME type.
     76    m_client->trackLoadStarted();
     77}
     78
     79void CueParser::didReceiveData(const char* data, int len)
     80{
     81    // FIXME(62893): Send data along to m_private parser to be parsed.
     82}
     83
     84void CueParser::didFinishLoading(unsigned long)
     85{
     86    m_client->trackLoadCompleted();
     87}
     88
     89void CueParser::didFail(const ResourceError&)
     90{
     91    m_client->trackLoadError();
     92}
     93
     94void CueParser::fetchParsedCues(Vector<RefPtr<TextTrackCue> >&)
    5995{
    6096    // FIXME(62893): Implement.
  • trunk/Source/WebCore/platform/track/CueParser.h

    r89186 r89711  
    4343namespace WebCore {
    4444
     45class ScriptExecutionContext;
    4546class TextTrackCue;
     47
     48class CueParserClient {
     49public:
     50    virtual void newCuesParsed() = 0;
     51    virtual void trackLoadStarted() = 0;
     52    virtual void trackLoadError() = 0;
     53    virtual void trackLoadCompleted() = 0;
     54};
    4655
    4756class CueParser : public ThreadableLoaderClient {
     
    5059    virtual ~CueParser();
    5160
    52     // ThreadableLoaderClient methods.
     61    void didReceiveResponse(unsigned long, const ResourceResponse&);
    5362    void didReceiveData(const char*, int);
     63    void didFinishLoading(unsigned long);
     64    void didFail(const ResourceError&);
    5465
    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> >&);
    5770
    5871private:
    5972    RefPtr<ThreadableLoader> m_loader;
    6073    OwnPtr<CueParserPrivateInterface> m_private;
     74    CueParserClient* m_client;
    6175};
    6276
Note: See TracChangeset for help on using the changeset viewer.