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

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

Issue 327553002: Transition networkState back to NETWORK_IDLE on fetch if preload=none (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reset deferred-FSM in prepareForLoad. Created 6 years, 6 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
Index: Source/core/html/HTMLMediaElement.h
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 9751bce17240837ee1b0724642488e6a6c1e1a40..fc008281d3779eac10e6c21fbcd511fb5e294c9e 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -361,7 +361,6 @@ private:
void loadResource(const KURL&, ContentType&, const String& keySystem);
void startPlayerLoad();
void setPlayerPreload();
- void startDelayedLoad();
blink::WebMediaPlayer::LoadType loadType() const;
void scheduleNextSourceChild();
void loadNextSourceChild();
@@ -379,6 +378,14 @@ private:
void mediaLoadingFailed(MediaPlayer::NetworkState);
+ // deferred loading (preload=none)
+ bool loadIsDeferred() const;
+ void deferredLoad();
+ void cancelDeferredLoad();
+ void startDeferredLoad();
+ void executeDeferredLoad();
+ void deferredLoadTimerFired(Timer<HTMLMediaElement>*);
+
void updateActiveTextTrackCues(double);
HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
@@ -458,6 +465,22 @@ private:
RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode;
RefPtrWillBeMember<Node> m_nextChildNodeToConsider;
+ // "Deferred loading" state (for preload=none).
+ enum DeferredLoadState {
+ // The load is not deferred.
+ NotDeferred,
+ // The load is deferred, and waiting for the task to set the
+ // delaying-the-load-event flag (to false).
+ WaitingForStopDelayingLoadEventTask,
+ // The load is the deferred, and waiting for a triggering event.
+ WaitingForTrigger,
+ // The load is deferred, and waiting for the task to set the
+ // delaying-the-load-event flag, after which the load will be executed.
+ ExecuteOnStopDelayingLoadEventTask
+ };
+ DeferredLoadState m_deferredLoadState;
+ Timer<HTMLMediaElement> m_deferredLoadTimer;
+
OwnPtr<MediaPlayer> m_player;
blink::WebLayer* m_webLayer;

Powered by Google App Engine
This is Rietveld 408576698