2011-10-18 Eric Carlson <eric.carlson@apple.com>
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 17:34:27 +0000 (17:34 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 17:34:27 +0000 (17:34 +0000)
commit024ba2a5df041aca4671022b3f3516f44328b658
tree7a7b27b6ac10bb825e99eb78e354ad20b31fe33a
parent1ff9edc66200392b75385e8e5fdcec88b3b89ff6
2011-10-18  Eric Carlson  <eric.carlson@apple.com>

        Use the new cached cue loader
        https://bugs.webkit.org/show_bug.cgi?id=70269

        Reviewed by Antti Koivisto.

        No new tests, no functionality changed.

        * CMakeLists.txt: Remove CueParser.cpp/h and CueParserPrivate.h.
        * GNUmakefile.list.am: Ditto.
        * WebCore.gypi: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::loadTextTracks):
        (WebCore::HTMLMediaElement::textTrackReadyStateChanged): New, not implemented yet.
        (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
        (WebCore::HTMLMediaElement::textTrackCreated): Ditto.
        (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
        (WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto.
        (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
        (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
        * html/HTMLMediaElement.h:

        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::load): Update for interface change
        (WebCore::HTMLTrackElement::textTrackLoadingCompleted): New, dispatch 'load' or 'error' event.
        * html/HTMLTrackElement.h:

        * html/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::LoadableTextTrack): Add TextTrackClient and TextTrackLoadingClient
            parameters.
        (WebCore::LoadableTextTrack::load): Make url parameter KURL instead of String. Create the
            cue loader, trigger the load.
        (WebCore::LoadableTextTrack::newCuesAvailable): New callback from the loader. Not implemented yet.
        (WebCore::LoadableTextTrack::cueLoadingStarted): Ditto.
        (WebCore::LoadableTextTrack::cueLoadingCompleted): Ditto.
        * html/LoadableTextTrack.h:

        * html/MutableTextTrack.cpp:
        (WebCore::MutableTextTrack::MutableTextTrack): Add TextTrackClient parameter.
        * html/MutableTextTrack.h:
        (WebCore::MutableTextTrack::create):

        * html/TextTrack.cpp:
        (WebCore::TextTrack::TextTrack): Add TextTrackClient parameter.
        (WebCore::TextTrack::~TextTrack): Tell the client to remove all cues, forget the client.
        (WebCore::TextTrack::setReadyState): Tell client about ready state change.
        (WebCore::TextTrack::setMode): Tell client about mode change.
        * html/TextTrack.h:
        (WebCore::TextTrackClient::textTrackAddCues): New client interface.
        (WebCore::TextTrackClient::textTrackRemoveCues): Ditto.
        (WebCore::TextTrackClient::textTrackAddCue): Ditto.
        (WebCore::TextTrackClient::textTrackRemoveCue): Ditto.
        (WebCore::TextTrack::create):
        (WebCore::TextTrack::trackType): New.
        (WebCore::TextTrack::client): Ditto.
        (WebCore::TextTrack::setClient): Ditto.

        * html/track/CueParser.cpp: Removed.
        * html/track/CueParser.h: Removed.
        * html/track/CueParserPrivate.h: Removed.

        * html/track/WebVTTParser.cpp:
        (WebCore::WebVTTParser::fileIdentifierMaximumLength): New, return length of WebVTT file
            magic number.
        (WebCore::WebVTTParser::hasRequiredFileIdentifier): Update to use constants instead of hard
            coded lengths.
        (WebCore::WebVTTParser::WebVTTParser): Initialize "m_client" in the initilization list
            instead of setting it in the constructor.
        (WebCore::WebVTTParser::getNewCues): Renamed from fetchParsedCues.
        * html/track/WebVTTParser.h:
        (WebCore::WebVTTParser::create): Take a WebVTTParserClient* instead of a CueParserPrivateClient*.

        * loader/CueLoader.cpp:
        (WebCore::CueLoader::CueLoader):
        (WebCore::CueLoader::~CueLoader): Remove client.
        (WebCore::CueLoader::cueLoadTimerFired): Tell client about new clues and/or that the load
            has finished.
        (WebCore::CueLoader::processNewCueData): Process newly loaded data.
        (WebCore::CueLoader::didReceiveData): Ditto.
        (WebCore::CueLoader::notifyFinished): Do final processing as necessary, prime the timer
            to call client.
        (WebCore::CueLoader::load): Create resource loader, initiate loading.
        (WebCore::CueLoader::newCuesParsed): Prime timer to tell client about newly parsed cues.
        (WebCore::CueLoader::getNewCues): Get new cues from parser.
        * loader/CueLoader.h:
        (WebCore::CueLoader::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
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/MutableTextTrack.cpp
Source/WebCore/html/MutableTextTrack.h
Source/WebCore/html/TextTrack.cpp
Source/WebCore/html/TextTrack.h
Source/WebCore/html/track/CueParser.cpp [deleted file]
Source/WebCore/html/track/CueParser.h [deleted file]
Source/WebCore/html/track/CueParserPrivate.h [deleted file]
Source/WebCore/html/track/WebVTTParser.cpp
Source/WebCore/html/track/WebVTTParser.h
Source/WebCore/loader/CueLoader.cpp
Source/WebCore/loader/CueLoader.h