Source/WebCore/ChangeLog

 12011-05-06 Victoria Kirst <vrk@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Adding initial interfaces and stubs for track
 6 https://bugs.webkit.org/show_bug.cgi?id=60379
 7
 8 This marks the first patch of a series to implement out-of-band
 9 <track> support in WebKit. This patch adds some of the core header files
 10 and their corresponding stub .cpp files.
 11
 12 No new tests because feature is hidden behind VIDEO_TRACK feature
 13 define, which is turned off.
 14
 15 * WebCore.gyp/WebCore.gyp:
 16 * WebCore.gypi:
 17 * html/CueIndex.cpp: Added.
 18 (WebCore::CueSet::difference):
 19 (WebCore::CueSet::unionSet):
 20 (WebCore::CueSet::add):
 21 (WebCore::CueSet::contains):
 22 (WebCore::CueSet::remove):
 23 (WebCore::CueSet::isEmpty):
 24 (WebCore::CueSet::size):
 25 (WebCore::CueIndex::takeNewCuesFrom):
 26 (WebCore::CueIndex::removeCuesFromIndex):
 27 (WebCore::CueIndex::getVisibleCues):
 28 (WebCore::CueIndex::add):
 29 (WebCore::CueIndex::remove):
 30 * html/CueIndex.h: Added.
 31 (WebCore::CueSet::CueSet):
 32 (WebCore::CueSet::~CueSet):
 33 * html/LoadableTextTrack.cpp: Added.
 34 (WebCore::LoadableTextTrack::LoadableTextTrack):
 35 (WebCore::LoadableTextTrack::~LoadableTextTrack):
 36 (WebCore::LoadableTextTrack::load):
 37 * html/LoadableTextTrack.h: Added.
 38 (WebCore::LoadableTextTrack::create):
 39 * html/LoadableTextTrackImpl.cpp: Added.
 40 (WebCore::LoadableTextTrackImpl::LoadableTextTrackImpl):
 41 (WebCore::LoadableTextTrackImpl::~LoadableTextTrackImpl):
 42 (WebCore::LoadableTextTrackImpl::kind):
 43 (WebCore::LoadableTextTrackImpl::label):
 44 (WebCore::LoadableTextTrackImpl::language):
 45 (WebCore::LoadableTextTrackImpl::readyState):
 46 (WebCore::LoadableTextTrackImpl::mode):
 47 (WebCore::LoadableTextTrackImpl::setMode):
 48 (WebCore::LoadableTextTrackImpl::cues):
 49 (WebCore::LoadableTextTrackImpl::activeCues):
 50 (WebCore::LoadableTextTrackImpl::popNewestCues):
 51 (WebCore::LoadableTextTrackImpl::load):
 52 (WebCore::LoadableTextTrackImpl::newCuesLoaded):
 53 * html/LoadableTextTrackImpl.h: Added.
 54 (WebCore::LoadableTextTrackImpl::create):
 55 * html/MutableTextTrack.cpp: Added.
 56 (WebCore::MutableTextTrack::MutableTextTrack):
 57 (WebCore::MutableTextTrack::addCue):
 58 (WebCore::MutableTextTrack::removeCue):
 59 * html/MutableTextTrack.h: Added.
 60 (WebCore::MutableTextTrack::create):
 61 (WebCore::MutableTextTrack::~MutableTextTrack):
 62 * html/MutableTextTrackImpl.cpp: Added.
 63 (WebCore::MutableTextTrackImpl::MutableTextTrackImpl):
 64 (WebCore::MutableTextTrackImpl::~MutableTextTrackImpl):
 65 (WebCore::MutableTextTrackImpl::addCue):
 66 (WebCore::MutableTextTrackImpl::removeCue):
 67 (WebCore::MutableTextTrackImpl::kind):
 68 (WebCore::MutableTextTrackImpl::label):
 69 (WebCore::MutableTextTrackImpl::language):
 70 (WebCore::MutableTextTrackImpl::readyState):
 71 (WebCore::MutableTextTrackImpl::mode):
 72 (WebCore::MutableTextTrackImpl::setMode):
 73 (WebCore::MutableTextTrackImpl::cues):
 74 (WebCore::MutableTextTrackImpl::activeCues):
 75 (WebCore::MutableTextTrackImpl::newCuesLoaded):
 76 (WebCore::MutableTextTrackImpl::popNewestCues):
 77 * html/MutableTextTrackImpl.h: Added.
 78 (WebCore::MutableTextTrackImpl::create):
 79 * html/TextTrack.cpp: Added.
 80 (WebCore::TextTrack::TextTrack):
 81 (WebCore::TextTrack::~TextTrack):
 82 (WebCore::TextTrack::kind):
 83 (WebCore::TextTrack::label):
 84 (WebCore::TextTrack::language):
 85 (WebCore::TextTrack::readyState):
 86 (WebCore::TextTrack::mode):
 87 (WebCore::TextTrack::setMode):
 88 (WebCore::TextTrack::cues):
 89 (WebCore::TextTrack::activeCues):
 90 * html/TextTrack.h: Added.
 91 (WebCore::TextTrackClient::~TextTrackClient):
 92 (WebCore::TextTrackClient::textTrackReadyStateChanged):
 93 (WebCore::TextTrackClient::textTrackModeChanged):
 94 (WebCore::TextTrackClient::textTrackCreated):
 95 (WebCore::TextTrack::create):
 96 * html/TextTrackCue.cpp: Added.
 97 (WebCore::TextTrackCue::TextTrackCue):
 98 (WebCore::TextTrackCue::~TextTrackCue):
 99 (WebCore::TextTrackCue::track):
 100 (WebCore::TextTrackCue::setTrack):
 101 (WebCore::TextTrackCue::id):
 102 (WebCore::TextTrackCue::startTime):
 103 (WebCore::TextTrackCue::endTime):
 104 (WebCore::TextTrackCue::pauseOnExit):
 105 (WebCore::TextTrackCue::direction):
 106 (WebCore::TextTrackCue::snapToLines):
 107 (WebCore::TextTrackCue::linePosition):
 108 (WebCore::TextTrackCue::textPosition):
 109 (WebCore::TextTrackCue::size):
 110 (WebCore::TextTrackCue::alignment):
 111 (WebCore::TextTrackCue::getCueAsSource):
 112 (WebCore::TextTrackCue::getCueAsHTML):
 113 (WebCore::TextTrackCue::isActive):
 114 (WebCore::TextTrackCue::setIsActive):
 115 * html/TextTrackCue.h: Added.
 116 (WebCore::TextTrackCue::create):
 117 * html/TextTrackCueList.cpp: Added.
 118 (WebCore::TextTrackCueList::TextTrackCueList):
 119 (WebCore::TextTrackCueList::getCueById):
 120 (WebCore::TextTrackCueList::append):
 121 (WebCore::TextTrackCueList::remove):
 122 * html/TextTrackCueList.h: Added.
 123 (WebCore::TextTrackCueList::create):
 124 * html/TextTrackPrivate.h: Added.
 125 (WebCore::TextTrackPrivateInterface::TextTrackPrivateInterface):
 126 (WebCore::TextTrackPrivateInterface::~TextTrackPrivateInterface):
 127 (WebCore::TextTrackPrivateInterface::load):
 128 * loader/CueLoader.cpp: Added.
 129 (WebCore::CueLoader::setCueLoaderClient):
 130 * loader/CueLoader.h: Added.
 131 * platform/track/CueParser.cpp: Added.
 132 (WebCore::CueParser::CueParser):
 133 (WebCore::CueParser::~CueParser):
 134 (WebCore::CueParser::load):
 135 (WebCore::CueParser::didReceiveData):
 136 (WebCore::CueParser::depleteParsedCues):
 137 * platform/track/CueParser.h: Added.
 138 * platform/track/CueParserPrivate.h: Added.
 139 (WebCore::CueParserPrivateInterface::~CueParserPrivateInterface):
 140 (WebCore::CueParserPrivateInterface::CueParserPrivateInterface):
 141
11422011-05-06 Eric Carlson <eric.carlson@apple.com>
2143
3144 Reviewed by Darin Adler.

Source/WebCore/WebCore.gyp/WebCore.gyp

192192 '../platform/sql',
193193 '../platform/text',
194194 '../platform/text/transcoder',
 195 '../platform/track',
195196 '../plugins',
196197 '../plugins/chromium',
197198 '../rendering',

Source/WebCore/WebCore.gypi

28032803 'html/CollectionCache.cpp',
28042804 'html/ColorInputType.cpp',
28052805 'html/ColorInputType.h',
 2806 'html/CueIndex.cpp',
 2807 'html/CueIndex.h',
28062808 'html/DOMFormData.cpp',
28072809 'html/DOMFormData.h',
28082810 'html/DOMSettableTokenList.cpp',

29942996 'html/IsIndexInputType.h',
29952997 'html/LabelsNodeList.cpp',
29962998 'html/LabelsNodeList.h',
 2999 'html/LoadableTextTrack.cpp',
 3000 'html/LoadableTextTrack.h',
 3001 'html/LoadableTextTrackImpl.cpp',
 3002 'html/LoadableTextTrackImpl.h',
29973003 'html/MediaDocument.cpp',
29983004 'html/MediaDocument.h',
29993005 'html/MediaError.h',
 3006 'html/MutableTextTrack.cpp',
 3007 'html/MutableTextTrack.h',
 3008 'html/MutableTextTrackImpl.cpp',
 3009 'html/MutableTextTrackImpl.h',
30003010 'html/MonthInputType.cpp',
30013011 'html/MonthInputType.h',
30023012 'html/NumberInputType.cpp',

30263036 'html/TextInputType.cpp',
30273037 'html/TextInputType.h',
30283038 'html/TextMetrics.h',
 3039 'html/TextTrack.cpp',
 3040 'html/TextTrack.h',
 3041 'html/TextTrackCue.cpp',
 3042 'html/TextTrackCue.h',
 3043 'html/TextTrackCueList.cpp',
 3044 'html/TextTrackCueList.h',
 3045 'html/TextTrackPrivateInterface.h',
30293046 'html/TimeInputType.cpp',
30303047 'html/TimeInputType.h',
30313048 'html/TimeRanges.cpp',

32833300 'loader/CrossOriginAccessControl.cpp',
32843301 'loader/CrossOriginAccessControl.h',
32853302 'loader/CrossOriginPreflightResultCache.cpp',
 3303 'loader/CueLoader.cpp',
 3304 'loader/CueLoader.h',
32863305 'loader/DocumentLoader.cpp',
32873306 'loader/DocumentThreadableLoader.cpp',
32883307 'loader/DocumentThreadableLoader.h',

49674986 'platform/text/wince/TextBreakIteratorWinCE.cpp',
49684987 'platform/text/wince/TextCodecWinCE.cpp',
49694988 'platform/text/wince/TextCodecWinCE.h',
 4989 'platform/track/CueParser.cpp',
 4990 'platform/track/CueParser.h',
 4991 'platform/track/CueParserPrivate.h',
49704992 'platform/win/BString.cpp',
49714993 'platform/win/BString.h',
49724994 'platform/win/BitmapInfo.cpp',

Source/WebCore/html/CueIndex.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "CueIndex.h"
 31
 32#include "TextTrackCue.h"
 33#include "TextTrackCueList.h"
 34
 35namespace WebCore {
 36
 37CueSet CueSet::difference(const CueSet& other) const
 38{
 39 return CueSet();
 40}
 41
 42CueSet CueSet::unionSet(const CueSet& other) const
 43{
 44 return CueSet();
 45}
 46
 47void CueSet::add(TextTrackCue* cue)
 48{
 49}
 50
 51bool CueSet::contains(TextTrackCue* cue) const
 52{
 53 return false;
 54}
 55
 56void CueSet::remove(TextTrackCue* cue)
 57{
 58}
 59
 60bool CueSet::isEmpty() const
 61{
 62 return false;
 63}
 64
 65int CueSet::size() const
 66{
 67 return 0;
 68}
 69
 70void CueIndex::takeNewCuesFrom(CueLoader* loader)
 71{
 72}
 73
 74void CueIndex::removeCuesFromIndex(const TextTrackCueList* cueList)
 75{
 76}
 77
 78CueSet CueIndex::getVisibleCues(double time) const
 79{
 80 return CueSet();
 81}
 82
 83void CueIndex::add(TextTrackCue* cue)
 84{
 85}
 86
 87void CueIndex::remove(TextTrackCue* cue)
 88{
 89}
 90
 91} // namespace WebCore
 92
 93#endif

Source/WebCore/html/CueIndex.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef CueIndex_h
 27#define CueIndex_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "CueLoader.h"
 32#include <wtf/HashSet.h>
 33
 34namespace WebCore {
 35
 36class TextTrackCue;
 37class TextTrackCueList;
 38
 39class CueSet {
 40public:
 41 CueSet() { }
 42 ~CueSet() { }
 43 CueSet difference(const CueSet& other) const;
 44 CueSet unionSet(const CueSet& other) const;
 45 void add(TextTrackCue*);
 46 bool contains(TextTrackCue*) const;
 47 void remove(TextTrackCue*);
 48 bool isEmpty() const;
 49 int size() const;
 50private:
 51 HashSet<TextTrackCue*> m_set;
 52};
 53
 54class CueIndex : public CueLoaderClient {
 55public:
 56 // CueLoaderClient methods.
 57 void takeNewCuesFrom(CueLoader*);
 58 void removeCuesFromIndex(const TextTrackCueList*);
 59
 60 // Returns set of cues visible at a time in seconds.
 61 CueSet getVisibleCues(double time) const;
 62 void add(TextTrackCue*);
 63 void remove(TextTrackCue*);
 64};
 65
 66} // namespace WebCore
 67
 68#endif
 69#endif

Source/WebCore/html/LoadableTextTrack.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "LoadableTextTrack.h"
 31
 32namespace WebCore {
 33
 34LoadableTextTrack::LoadableTextTrack(ScriptExecutionContext* context, const String& kind, const String& label, const String& language, bool isDefault)
 35 : TextTrack(context)
 36{
 37}
 38
 39LoadableTextTrack::~LoadableTextTrack()
 40{
 41}
 42
 43void LoadableTextTrack::load(const String& url)
 44{
 45}
 46
 47} // namespace WebCore
 48
 49#endif

Source/WebCore/html/LoadableTextTrack.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef LoadableTextTrack_h
 27#define LoadableTextTrack_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "LoadableTextTrackImpl.h"
 32#include "PassRefPtr.h"
 33#include "TextTrack.h"
 34#include "TextTrackCueList.h"
 35
 36namespace WebCore {
 37
 38class ScriptExecutionContext;
 39
 40class LoadableTextTrack : public TextTrack {
 41public:
 42 static PassRefPtr<LoadableTextTrack> create(ScriptExecutionContext* context, const String& kind, const String& label, const String& language, bool isDefault)
 43 {
 44 return adoptRef(new LoadableTextTrack(context, kind, label, language, isDefault));
 45 }
 46 virtual ~LoadableTextTrack();
 47
 48 void load(const String& url);
 49
 50private:
 51 LoadableTextTrack(ScriptExecutionContext*, const String& kind, const String& label, const String& language, bool isDefault);
 52
 53};
 54} // namespace WebCore
 55
 56#endif
 57#endif

Source/WebCore/html/LoadableTextTrackImpl.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "LoadableTextTrackImpl.h"
 31
 32#include "TextTrackCueList.h"
 33
 34namespace WebCore {
 35
 36LoadableTextTrackImpl::LoadableTextTrackImpl(ScriptExecutionContext* context, const String& kind, const String& label, const String& language, bool isDefault)
 37 : m_kind(kind)
 38 , m_label(label)
 39 , m_language(language)
 40{
 41}
 42
 43LoadableTextTrackImpl::~LoadableTextTrackImpl()
 44{
 45}
 46
 47String LoadableTextTrackImpl::kind() const
 48{
 49 return m_kind;
 50}
 51
 52String LoadableTextTrackImpl::label() const
 53{
 54 return m_label;
 55}
 56
 57String LoadableTextTrackImpl::language() const
 58{
 59 return m_language;
 60}
 61
 62TextTrack::ReadyState LoadableTextTrackImpl::readyState() const
 63{
 64 return m_readyState;
 65}
 66
 67TextTrack::Mode LoadableTextTrackImpl::mode() const
 68{
 69 return m_mode;
 70}
 71
 72void LoadableTextTrackImpl::setMode(TextTrack::Mode mode)
 73{
 74}
 75
 76TextTrackCueList* LoadableTextTrackImpl::cues() const
 77{
 78 return 0;
 79}
 80
 81TextTrackCueList* LoadableTextTrackImpl::activeCues() const
 82{
 83 return 0;
 84}
 85
 86void LoadableTextTrackImpl::popNewestCues(Vector<TextTrackCue*>& output)
 87{
 88}
 89
 90void LoadableTextTrackImpl::load(const String& url)
 91{
 92}
 93
 94void LoadableTextTrackImpl::newCuesLoaded()
 95{
 96}
 97
 98} // namespace WebCore
 99
 100#endif

Source/WebCore/html/LoadableTextTrackImpl.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef LoadableTextTrackImpl_h
 27#define LoadableTextTrackImpl_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "CueLoader.h"
 32#include "CueParser.h"
 33#include "TextTrackPrivate.h"
 34#include <wtf/PassRefPtr.h>
 35#include <wtf/Vector.h>
 36
 37namespace WebCore {
 38
 39class ScriptExecutionContext;
 40class TextTrack;
 41class TextTrackCue;
 42class TextTrackCueList;
 43
 44class LoadableTextTrackImpl : public TextTrackPrivateInterface, public CueLoader {
 45public:
 46 static PassOwnPtr<LoadableTextTrackImpl> create(ScriptExecutionContext* context, const String& kind, const String& label, const String& language, bool isDefault)
 47 {
 48 return adoptPtr(new LoadableTextTrackImpl(context, kind, label, language, isDefault));
 49 }
 50 virtual ~LoadableTextTrackImpl();
 51
 52 // TextTrackPrivateInterface methods
 53 virtual String kind() const;
 54 virtual String label() const;
 55 virtual String language() const;
 56 virtual TextTrack::ReadyState readyState() const;
 57 virtual TextTrack::Mode mode() const;
 58 virtual void setMode(TextTrack::Mode);
 59 virtual TextTrackCueList* cues() const;
 60 virtual TextTrackCueList* activeCues() const;
 61 virtual void load(const String& url);
 62
 63 // CueLoader interface
 64 virtual void newCuesLoaded();
 65 virtual void popNewestCues(Vector<TextTrackCue*>&);
 66
 67private:
 68 LoadableTextTrackImpl(ScriptExecutionContext*, const String& kind, const String& label, const String& language, bool isDefault);
 69
 70 String m_kind;
 71 String m_label;
 72 String m_language;
 73 TextTrack::ReadyState m_readyState;
 74 TextTrack::Mode m_mode;
 75
 76 CueParser m_parser;
 77 RefPtr<TextTrackCueList> m_cues;
 78};
 79
 80} // namespace WebCore
 81
 82#endif
 83#endif

Source/WebCore/html/MutableTextTrack.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "MutableTextTrack.h"
 31
 32#include "MutableTextTrackImpl.h"
 33
 34namespace WebCore {
 35
 36MutableTextTrack::MutableTextTrack(ScriptExecutionContext* context, const String& kind, const String& label, const String& language)
 37 : TextTrack(context)
 38{
 39}
 40
 41void MutableTextTrack::addCue(TextTrackCue* cue)
 42{
 43}
 44void MutableTextTrack::removeCue(TextTrackCue* cue)
 45{
 46}
 47
 48} // namespace WebCore
 49
 50#endif

Source/WebCore/html/MutableTextTrack.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MutableTextTrack_h
 27#define MutableTextTrack_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "TextTrack.h"
 32
 33namespace WebCore {
 34
 35class TextTrackCue;
 36
 37class MutableTextTrack : public TextTrack {
 38public:
 39 static PassRefPtr<MutableTextTrack> create(ScriptExecutionContext* context, const String& kind, const String& label, const String& language)
 40 {
 41 return adoptRef(new MutableTextTrack(context, kind, label, language));
 42 }
 43 virtual ~MutableTextTrack() { }
 44
 45 void addCue(TextTrackCue*);
 46 void removeCue(TextTrackCue*);
 47private:
 48 MutableTextTrack(ScriptExecutionContext*, const String& kind, const String& label, const String& language);
 49};
 50
 51} // namespace WebCore
 52
 53#endif
 54#endif

Source/WebCore/html/MutableTextTrackImpl.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "MutableTextTrackImpl.h"
 31
 32#include "TextTrack.h"
 33#include "TextTrackCue.h"
 34#include "TextTrackCueList.h"
 35
 36namespace WebCore {
 37
 38MutableTextTrackImpl::MutableTextTrackImpl(ScriptExecutionContext* context, const String& kind, const String& label, const String& language)
 39 : m_kind(kind)
 40 , m_label(label)
 41 , m_language(language)
 42{
 43}
 44
 45MutableTextTrackImpl::~MutableTextTrackImpl()
 46{
 47}
 48
 49void MutableTextTrackImpl::addCue(TextTrackCue* cue)
 50{
 51}
 52
 53void MutableTextTrackImpl::removeCue(TextTrackCue* cue)
 54{
 55}
 56
 57String MutableTextTrackImpl::kind() const
 58{
 59 return m_kind;
 60}
 61
 62String MutableTextTrackImpl::label() const
 63{
 64 return m_label;
 65}
 66
 67String MutableTextTrackImpl::language() const
 68{
 69 return m_language;
 70}
 71
 72TextTrack::ReadyState MutableTextTrackImpl::readyState() const
 73{
 74 return m_readyState;
 75}
 76
 77TextTrack::Mode MutableTextTrackImpl::mode() const
 78{
 79 return m_mode;
 80}
 81
 82void MutableTextTrackImpl::setMode(TextTrack::Mode mode)
 83{
 84}
 85
 86TextTrackCueList* MutableTextTrackImpl::cues() const
 87{
 88 return 0;
 89}
 90
 91TextTrackCueList* MutableTextTrackImpl::activeCues() const
 92{
 93 return 0;
 94}
 95
 96void MutableTextTrackImpl::newCuesLoaded()
 97{
 98}
 99
 100void MutableTextTrackImpl::popNewestCues(Vector<TextTrackCue*>& output)
 101{
 102}
 103
 104} // namespace WebCore
 105
 106#endif

Source/WebCore/html/MutableTextTrackImpl.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MutableTextTrackImpl_h
 27#define MutableTextTrackImpl_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "CueLoader.h"
 32#include "TextTrackPrivate.h"
 33#include <wtf/PassRefPtr.h>
 34#include <wtf/Vector.h>
 35
 36namespace WebCore {
 37
 38class CueLoaderClient;
 39class ScriptExecutionContext;
 40class TextTrack;
 41class TextTrackCue;
 42class TextTrackCueList;
 43
 44class MutableTextTrackImpl : public TextTrackPrivateInterface, public CueLoader {
 45public:
 46 static PassOwnPtr<MutableTextTrackImpl> create(ScriptExecutionContext* context, const String& kind, const String& label, const String& language)
 47 {
 48 return adoptPtr(new MutableTextTrackImpl(context, kind, label, language));
 49 }
 50 virtual ~MutableTextTrackImpl();
 51
 52 // TextTrackPrivateInterface methods
 53 virtual String kind() const;
 54 virtual String label() const;
 55 virtual String language() const;
 56 virtual TextTrack::ReadyState readyState() const;
 57 virtual TextTrack::Mode mode() const;
 58 virtual void setMode(TextTrack::Mode);
 59 virtual TextTrackCueList* cues() const;
 60 virtual TextTrackCueList* activeCues() const;
 61 virtual void addCue(TextTrackCue*);
 62 virtual void removeCue(TextTrackCue*);
 63
 64 // CueLoader interface
 65 virtual void newCuesLoaded();
 66 virtual void popNewestCues(Vector<TextTrackCue*>&);
 67
 68private:
 69 MutableTextTrackImpl(ScriptExecutionContext*, const String& kind, const String& label, const String& language);
 70
 71 String m_kind;
 72 String m_label;
 73 String m_language;
 74 TextTrack::ReadyState m_readyState;
 75 TextTrack::Mode m_mode;
 76
 77 RefPtr<TextTrackCueList> m_cues;
 78 Vector<TextTrackCue*> m_newestCues;
 79};
 80
 81} // namespace WebCore
 82
 83#endif
 84#endif

Source/WebCore/html/TextTrack.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31#include "config.h"
 32
 33#if ENABLE(VIDEO_TRACK)
 34
 35#include "TextTrack.h"
 36
 37#include "TextTrackCueList.h"
 38#include "TextTrackPrivate.h"
 39
 40namespace WebCore {
 41
 42TextTrack::TextTrack(ScriptExecutionContext* context)
 43{
 44}
 45
 46TextTrack::~TextTrack()
 47{
 48}
 49
 50String TextTrack::kind() const
 51{
 52 return m_private->kind();
 53}
 54
 55String TextTrack::label() const
 56{
 57 return m_private->label();
 58}
 59
 60String TextTrack::language() const
 61{
 62 return m_private->language();
 63}
 64
 65TextTrack::ReadyState TextTrack::readyState() const
 66{
 67 return m_private->readyState();
 68}
 69
 70TextTrack::Mode TextTrack::mode() const
 71{
 72 return m_private->mode();
 73}
 74
 75void TextTrack::setMode(unsigned short mode, ExceptionCode& ec)
 76{
 77}
 78
 79TextTrackCueList* TextTrack::cues() const
 80{
 81 return 0;
 82
 83}
 84
 85TextTrackCueList* TextTrack::activeCues() const
 86{
 87 return 0;
 88}
 89
 90} // namespace WebCore
 91
 92#endif

Source/WebCore/html/TextTrack.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef TextTrack_h
 27#define TextTrack_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "EventTarget.h"
 32#include <wtf/PassOwnPtr.h>
 33#include <wtf/RefCounted.h>
 34#include <wtf/text/WTFString.h>
 35
 36namespace WebCore {
 37
 38class ScriptExecutionContext;
 39class TextTrack;
 40class TextTrackCueList;
 41class TextTrackPrivateInterface;
 42
 43class TextTrackClient {
 44public:
 45 virtual ~TextTrackClient() { }
 46 virtual void textTrackReadyStateChanged(TextTrack*) { }
 47 virtual void textTrackModeChanged(TextTrack*) { }
 48 virtual void textTrackCreated(TextTrack*) { }
 49};
 50
 51class TextTrack : public RefCounted<TextTrack> {
 52public:
 53 static PassRefPtr<TextTrack> create(ScriptExecutionContext* context)
 54 {
 55 return adoptRef(new TextTrack(context));
 56 }
 57 virtual ~TextTrack();
 58
 59 String kind() const;
 60 String label() const;
 61 String language() const;
 62
 63 enum ReadyState { NONE, LOADING, LOADED, ERROR };
 64 ReadyState readyState() const;
 65
 66 enum Mode { OFF, HIDDEN, SHOWING };
 67 Mode mode() const;
 68 void setMode(unsigned short, ExceptionCode&);
 69
 70 TextTrackCueList* cues() const;
 71 TextTrackCueList* activeCues() const;
 72
 73 void readyStateChanged();
 74 void modeChanged();
 75
 76protected:
 77 TextTrack(ScriptExecutionContext*);
 78 OwnPtr<TextTrackPrivateInterface> m_private;
 79
 80};
 81
 82} // namespace WebCore
 83
 84#endif
 85#endif

Source/WebCore/html/TextTrackCue.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "TextTrackCue.h"
 31
 32#include "DocumentFragment.h"
 33#include "TextTrack.h"
 34
 35namespace WebCore {
 36
 37TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, const double start, const double end, const String& content, const String& settings, const bool pauseOnExit)
 38 : m_id(id)
 39 , m_startTime(start)
 40 , m_endTime(end)
 41 , m_content(content)
 42 , m_settings(settings)
 43 , m_pauseOnExit(pauseOnExit)
 44{
 45}
 46
 47TextTrackCue::~TextTrackCue()
 48{
 49}
 50
 51TextTrack* TextTrackCue::track() const
 52{
 53 return m_track;
 54}
 55
 56void TextTrackCue::setTrack(TextTrack* track)
 57{
 58}
 59
 60String TextTrackCue::id() const
 61{
 62 return m_id;
 63}
 64
 65double TextTrackCue::startTime() const
 66{
 67 return m_startTime;
 68}
 69
 70double TextTrackCue::endTime() const
 71{
 72 return m_endTime;
 73}
 74
 75bool TextTrackCue::pauseOnExit() const
 76{
 77 return m_pauseOnExit;
 78}
 79
 80String TextTrackCue::direction() const
 81{
 82 return "";
 83}
 84
 85bool TextTrackCue::snapToLines() const
 86{
 87 return false;
 88}
 89
 90long TextTrackCue::linePosition() const
 91{
 92 return -1;
 93}
 94
 95long TextTrackCue::textPosition() const
 96{
 97 return -1;
 98}
 99
 100long TextTrackCue::size() const
 101{
 102 return -1;
 103}
 104
 105String TextTrackCue::alignment() const
 106{
 107 return "";
 108}
 109
 110String TextTrackCue::getCueAsSource()
 111{
 112 return "";
 113}
 114
 115PassRefPtr<DocumentFragment> TextTrackCue::getCueAsHTML()
 116{
 117 return DocumentFragment::create(0);
 118}
 119
 120bool TextTrackCue::isActive()
 121{
 122 return false;
 123}
 124
 125void TextTrackCue::setIsActive(bool active)
 126{
 127}
 128
 129} // namespace WebCore
 130
 131#endif

Source/WebCore/html/TextTrackCue.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef TextTrackCue_h
 27#define TextTrackCue_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "TextTrack.h"
 32#include <wtf/PassOwnPtr.h>
 33#include <wtf/RefCounted.h>
 34
 35namespace WebCore {
 36
 37class DocumentFragment;
 38class ScriptExecutionContext;
 39class TextTrack;
 40
 41class TextTrackCue : public RefCounted<TextTrackCue> {
 42public:
 43 static PassRefPtr<TextTrackCue> create(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit)
 44 {
 45 return adoptRef(new TextTrackCue(context, id, start, end, content, settings, pauseOnExit));
 46 }
 47
 48 virtual ~TextTrackCue();
 49
 50 TextTrack* track() const;
 51 void setTrack(TextTrack*);
 52
 53 String id() const;
 54 double startTime() const;
 55 double endTime() const;
 56 bool pauseOnExit() const;
 57
 58 String direction() const;
 59 bool snapToLines() const;
 60 long linePosition() const;
 61 long textPosition() const;
 62 long size() const;
 63 String alignment() const;
 64
 65 String getCueAsSource();
 66 PassRefPtr<DocumentFragment> getCueAsHTML();
 67
 68 bool isActive();
 69 void setIsActive(bool);
 70
 71private:
 72 TextTrackCue(ScriptExecutionContext*, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit);
 73
 74 String m_id;
 75 double m_startTime;
 76 double m_endTime;
 77 String m_content;
 78 String m_settings;
 79 bool m_pauseOnExit;
 80 bool m_isActive;
 81
 82 TextTrack* m_track;
 83};
 84
 85} // namespace WebCore
 86
 87#endif
 88#endif

Source/WebCore/html/TextTrackCueList.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "TextTrackCueList.h"
 31
 32namespace WebCore {
 33
 34TextTrackCueList::TextTrackCueList(ScriptExecutionContext* context)
 35{
 36}
 37
 38TextTrackCue* TextTrackCueList::getCueById(const String& id) const
 39{
 40 return 0;
 41}
 42
 43void TextTrackCueList::append(Vector<PassRefPtr<TextTrackCue> >& newCues)
 44{
 45}
 46
 47void TextTrackCueList::append(const PassRefPtr<TextTrackCue>& cue)
 48{
 49}
 50
 51void TextTrackCueList::remove(const PassRefPtr<TextTrackCue>& cue)
 52{
 53}
 54
 55} // namespace WebCore
 56
 57#endif

Source/WebCore/html/TextTrackCueList.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef TextTrackCueList_h
 27#define TextTrackCueList_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "PassRefPtr.h"
 32#include "TextTrackCue.h"
 33#include <wtf/RefCounted.h>
 34#include <wtf/Vector.h>
 35
 36namespace WebCore {
 37
 38class ScriptExecutionContext;
 39
 40class TextTrackCueList : public RefCounted<TextTrackCueList> {
 41public:
 42 static PassRefPtr<TextTrackCueList> create(ScriptExecutionContext* context)
 43 {
 44 return adoptRef(new TextTrackCueList(context));
 45 }
 46
 47 unsigned long length() const;
 48 TextTrackCue* getCueById(const String&) const;
 49 TextTrackCueList* activeCues();
 50
 51 void append(const PassRefPtr<TextTrackCue>&);
 52 void append(Vector<PassRefPtr<TextTrackCue> >&);
 53 void remove(const PassRefPtr<TextTrackCue>&);
 54
 55private:
 56 TextTrackCueList(ScriptExecutionContext*);
 57 Vector <RefPtr<TextTrackCue> > m_list;
 58};
 59
 60} // namespace WebCore
 61
 62#endif
 63#endif

Source/WebCore/html/TextTrackPrivate.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef TextTrackPrivate_h
 27#define TextTrackPrivate_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include "TextTrack.h"
 32#include <wtf/Forward.h>
 33#include <wtf/Noncopyable.h>
 34
 35namespace WebCore {
 36
 37class CueLoaderClient;
 38class TextTrackCueList;
 39class ScriptExecutionContext;
 40
 41class TextTrackPrivateInterface {
 42 WTF_MAKE_NONCOPYABLE(TextTrackPrivateInterface); WTF_MAKE_FAST_ALLOCATED;
 43public:
 44 TextTrackPrivateInterface() { }
 45 virtual ~TextTrackPrivateInterface() { }
 46
 47 virtual String kind() const = 0;
 48 virtual String label() const = 0;
 49 virtual String language() const = 0;
 50
 51 virtual TextTrack::ReadyState readyState() const = 0;
 52
 53 virtual TextTrack::Mode mode() const = 0;
 54 virtual void setMode(TextTrack::Mode) = 0;
 55
 56 virtual TextTrackCueList* cues() const = 0;
 57 virtual TextTrackCueList* activeCues() const = 0;
 58
 59 // This method should only be overridden by tracks that load cue data
 60 // from a URL.
 61 virtual void load(const String& url) { }
 62};
 63
 64} // namespace WebCore
 65
 66#endif
 67#endif

Source/WebCore/loader/CueLoader.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(VIDEO_TRACK)
 29
 30#include "CueLoader.h"
 31
 32namespace WebCore {
 33
 34void CueLoader::setCueLoaderClient(CueLoaderClient* client)
 35{
 36 m_client = client;
 37}
 38
 39}
 40
 41#endif

Source/WebCore/loader/CueLoader.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef CueLoader_h
 27#define CueLoader_h
 28
 29#if ENABLE(VIDEO_TRACK)
 30
 31#include <wtf/Vector.h>
 32
 33namespace WebCore {
 34
 35class CueLoader;
 36class TextTrackCue;
 37class TextTrackCueList;
 38
 39// Listener to CueLoader.
 40class CueLoaderClient {
 41public:
 42 // Queries CueLoader for newest cues.
 43 virtual void takeNewCuesFrom(CueLoader*) = 0;
 44 virtual void removeCuesFromIndex(const TextTrackCueList*) = 0;
 45};
 46
 47class CueLoader {
 48public:
 49 void setCueLoaderClient(CueLoaderClient*);
 50
 51 // Informs client that new cues have been loaded.
 52 virtual void newCuesLoaded() = 0;
 53
 54 // Transfers ownership of currently loaded cues into outCues.
 55 virtual void popNewestCues(Vector<TextTrackCue*>& outCues) = 0;
 56
 57protected:
 58 CueLoaderClient* m_client;
 59};
 60
 61}
 62
 63#endif
 64#endif

Source/WebCore/platform/track/CueParser.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31#include "config.h"
 32
 33#if ENABLE(VIDEO_TRACK)
 34
 35#include "CueParser.h"
 36
 37namespace WebCore {
 38
 39CueParser::CueParser()
 40{
 41}
 42
 43CueParser::~CueParser()
 44{
 45}
 46
 47void CueParser::load(ScriptExecutionContext* context, const String& url)
 48{
 49}
 50
 51void CueParser::didReceiveData(const char* data, int len)
 52{
 53}
 54
 55void CueParser::depleteParsedCues(Vector<PassRefPtr<TextTrackCue> >& outputCues)
 56{
 57}
 58
 59} // namespace WebCore
 60
 61#endif

Source/WebCore/platform/track/CueParser.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31#ifndef CueParser_h
 32#define CueParser_h
 33
 34#if ENABLE(VIDEO_TRACK)
 35
 36#include "CueParserPrivate.h"
 37#include "ThreadableLoader.h"
 38#include "ThreadableLoaderClient.h"
 39#include <wtf/RefCounted.h>
 40#include <wtf/Vector.h>
 41#include <wtf/text/WTFString.h>
 42
 43namespace WebCore {
 44
 45class ScriptExecutionContext;
 46class TextTrackCue;
 47
 48class CueParser : public ThreadableLoaderClient {
 49public:
 50 CueParser();
 51 virtual ~CueParser();
 52
 53 // ThreadableLoaderClient methods.
 54 void didReceiveData(const char* data, int dataLength);
 55
 56 void load(ScriptExecutionContext*, const String& url);
 57 void depleteParsedCues(Vector<PassRefPtr<TextTrackCue> >& outputCues);
 58
 59private:
 60 RefPtr<ThreadableLoader> m_loader;
 61 OwnPtr<CueParserPrivateInterface> m_private;
 62};
 63
 64} // namespace WebCore
 65
 66#endif
 67#endif

Source/WebCore/platform/track/CueParserPrivate.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31#ifndef CueParserPrivate_h
 32#define CueParsePrivate_h
 33
 34#if ENABLE(VIDEO_TRACK)
 35
 36#include "TextTrackCue.h"
 37#include <wtf/Forward.h>
 38#include <wtf/Noncopyable.h>
 39#include <wtf/Vector.h>
 40
 41namespace WebCore {
 42
 43class CueParserPrivateClient {
 44public:
 45 virtual void newCuesParsed() = 0;
 46};
 47
 48class CueParserPrivateInterface {
 49 WTF_MAKE_NONCOPYABLE(CueParserPrivateInterface); WTF_MAKE_FAST_ALLOCATED;
 50public:
 51 virtual ~CueParserPrivateInterface() { }
 52
 53 // Types of CueParserPrivateInterfaces that are supported.
 54 enum Format { WebVTT, XML };
 55
 56 // Input data to the parser to parse.
 57 virtual void parseBytes(const char* bytes, int length) = 0;
 58
 59 // Transfers ownership of last parsed cues to caller.
 60 virtual void depleteParsedCues(Vector<PassRefPtr<TextTrackCue> >& outputCues) = 0;
 61
 62protected:
 63 CueParserPrivateInterface() { }
 64};
 65
 66} // namespace WebCore
 67
 68#endif
 69#endif