Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Unified Diff: Source/core/html/track/LoadableTextTrack.cpp

Issue 177003025: Remove TextTrackClient interface to simplify TextTrack code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/track/LoadableTextTrack.h ('k') | Source/core/html/track/TextTrack.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/LoadableTextTrack.cpp
diff --git a/Source/core/html/track/LoadableTextTrack.cpp b/Source/core/html/track/LoadableTextTrack.cpp
index 6089405b11b64c1062b53b28449f2a5073e337d7..dd692848f1118ffa4a7164944fd5548c28c2a8a7 100644
--- a/Source/core/html/track/LoadableTextTrack.cpp
+++ b/Source/core/html/track/LoadableTextTrack.cpp
@@ -27,6 +27,7 @@
#include "core/html/track/LoadableTextTrack.h"
#include "core/dom/ElementTraversal.h"
+#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLTrackElement.h"
#include "core/html/track/TextTrackCueList.h"
#include "core/html/track/vtt/VTTRegionList.h"
@@ -36,7 +37,7 @@ namespace WebCore {
using namespace HTMLNames;
LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track)
- : TextTrack(track->document(), track, emptyAtom, emptyAtom, emptyAtom, emptyAtom, TrackElement)
+ : TextTrack(track->document(), emptyAtom, emptyAtom, emptyAtom, emptyAtom, TrackElement)
, m_trackElement(track)
, m_loadTimer(this, &LoadableTextTrack::loadTimerFired)
, m_isDefault(false)
@@ -45,12 +46,22 @@ LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track)
LoadableTextTrack::~LoadableTextTrack()
{
+ ASSERT(!m_trackElement);
}
-void LoadableTextTrack::clearClient()
+void LoadableTextTrack::clearTrackElement()
{
m_trackElement = 0;
- TextTrack::clearClient();
+}
+
+void LoadableTextTrack::setMode(const AtomicString& mode)
+{
+ TextTrack::setMode(mode);
+ if (!m_trackElement)
+ return;
+
+ if (m_trackElement->readyState() == HTMLTrackElement::NONE)
+ m_trackElement->scheduleLoad();
}
void LoadableTextTrack::scheduleLoad(const KURL& url)
@@ -111,8 +122,8 @@ void LoadableTextTrack::newCuesAvailable(TextTrackLoader* loader)
m_cues->add(newCues[i]);
}
- if (client())
- client()->textTrackAddCues(this, m_cues.get());
+ if (mediaElement())
+ mediaElement()->textTrackAddCues(this, m_cues.get());
}
void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadingFailed)
@@ -157,4 +168,3 @@ size_t LoadableTextTrack::trackElementIndex()
}
} // namespace WebCore
-
« no previous file with comments | « Source/core/html/track/LoadableTextTrack.h ('k') | Source/core/html/track/TextTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698