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

Unified Diff: Source/core/html/HTMLTrackElement.h

Issue 999773002: Move loading machinery out of LoadableTextTrack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments; Use switch for same-url case. Created 5 years, 9 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 | « no previous file | Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTrackElement.h
diff --git a/Source/core/html/HTMLTrackElement.h b/Source/core/html/HTMLTrackElement.h
index a2cd4404e11824b18cc2b4e4532364e5625ad803..d4e08fe157ae370562d658ce452fc0e0f7ba2f9f 100644
--- a/Source/core/html/HTMLTrackElement.h
+++ b/Source/core/html/HTMLTrackElement.h
@@ -27,15 +27,16 @@
#define HTMLTrackElement_h
#include "core/html/HTMLElement.h"
-#include "core/html/track/LoadableTextTrack.h"
#include "core/html/track/TextTrack.h"
+#include "core/loader/TextTrackLoader.h"
#include "platform/heap/Handle.h"
namespace blink {
class HTMLMediaElement;
+class LoadableTextTrack;
-class HTMLTrackElement final : public HTMLElement {
+class HTMLTrackElement final : public HTMLElement, private TextTrackLoaderClient {
DEFINE_WRAPPERTYPEINFO();
public:
DECLARE_NODE_FACTORY(HTMLTrackElement);
@@ -43,18 +44,16 @@ public:
const AtomicString& kind();
void setKind(const AtomicString&);
- enum ReadyState { NONE = 0, LOADING = 1, LOADED = 2, TRACK_ERROR = 3 };
+ enum ReadyState {
+ NONE = 0,
+ LOADING = 1,
+ LOADED = 2,
+ TRACK_ERROR = 3
+ };
ReadyState readyState();
- void setReadyState(ReadyState);
-
- TextTrack* track();
-
void scheduleLoad();
- enum LoadStatus { Failure, Success };
- void didCompleteLoad(LoadStatus);
-
- const AtomicString& mediaElementCrossOriginAttribute() const;
+ TextTrack* track();
DECLARE_VIRTUAL_TRACE();
@@ -69,15 +68,31 @@ private:
virtual void removedFrom(ContainerNode*) override;
virtual bool isURLAttribute(const Attribute&) const override;
+ // TextTrackLoaderClient
+ virtual void newCuesAvailable(TextTrackLoader*) override;
+ virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) override;
+ virtual void newRegionsAvailable(TextTrackLoader*) override;
+
+ void setReadyState(ReadyState);
+
+ const AtomicString& mediaElementCrossOriginAttribute() const;
+ bool canLoadUrl(const KURL&);
void loadTimerFired(Timer<HTMLTrackElement>*);
+ enum LoadStatus {
+ Failure,
+ Success
+ };
+ void didCompleteLoad(LoadStatus);
+
HTMLMediaElement* mediaElement() const;
LoadableTextTrack* ensureTrack();
- bool canLoadUrl(const KURL&);
RefPtrWillBeMember<LoadableTextTrack> m_track;
+ OwnPtrWillBeMember<TextTrackLoader> m_loader;
Timer<HTMLTrackElement> m_loadTimer;
+ KURL m_url;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698