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

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

Issue 144663006: Remove the user gesture restriction for HTMLMediaElement::load() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: keep removeBehaviorsRestrictionsAfterFirstUserGesture() 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
Index: Source/core/html/HTMLMediaElement.h
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index dc94b2e875260dc585cbc3f8f29e94857a5e8274..718303644bcbee279615a7da42e7af9a2312adea 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -300,14 +300,12 @@ protected:
// Restrictions to change default behaviors.
enum BehaviorRestrictionFlags {
NoRestrictions = 0,
- RequireUserGestureForLoadRestriction = 1 << 0,
- RequireUserGestureForPlayRestriction = 1 << 1,
- RequireUserGestureForFullscreenRestriction = 1 << 2,
- RequirePageConsentToLoadMediaRestriction = 1 << 3,
+ RequireUserGestureForPlayRestriction = 1 << 0,
+ RequireUserGestureForFullscreenRestriction = 1 << 1,
+ RequirePageConsentToLoadMediaRestriction = 1 << 2,
};
typedef unsigned BehaviorRestrictions;
- bool userGestureRequiredForLoad() const { return m_restrictions & RequireUserGestureForLoadRestriction; }
bool userGestureRequiredForPlay() const { return m_restrictions & RequireUserGestureForPlayRestriction; }
bool userGestureRequiredForFullscreen() const { return m_restrictions & RequireUserGestureForFullscreenRestriction; }
bool pageConsentRequiredForLoad() const { return m_restrictions & RequirePageConsentToLoadMediaRestriction; }
@@ -383,6 +381,8 @@ private:
void scheduleEvent(const AtomicString& eventName);
// loading
+ void prepareForLoad();
+ void loadInternal();
void selectMediaResource();
void loadResource(const KURL&, ContentType&, const String& keySystem);
void scheduleNextSourceChild();
@@ -406,11 +406,9 @@ private:
void markCaptionAndSubtitleTracksAsUnconfigured();
- // These "internal" functions do not check user gesture restrictions.
- void loadInternal();
+ // This does not check user gesture restrictions.
void playInternal();
- void prepareForLoad();
void allowVideoRendering();
void updateVolume();
@@ -540,7 +538,6 @@ private:
bool m_closedCaptionsVisible : 1;
- bool m_loadInitiatedByUserGesture : 1;
bool m_completelyLoaded : 1;
bool m_havePreparedToPlay : 1;
« no previous file with comments | « LayoutTests/media/video-load-require-user-gesture-expected.txt ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698