Title: [187688] trunk/Source/WebCore
- Revision
- 187688
- Author
- [email protected]
- Date
- 2015-07-31 15:59:04 -0700 (Fri, 31 Jul 2015)
Log Message
[iOS] use a media-specific user gesture check
https://bugs.webkit.org/show_bug.cgi?id=147509
Reviewed by Jer Noble.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::processingUserGestureForMedia): New.
* bindings/js/ScriptController.h:
* dom/UserGestureIndicator.cpp:
(WebCore::isDefinite): Allow DefinitelyProcessingMediaUserGesture.
(WebCore::UserGestureIndicator::processingUserGestureForMedia): New.
* dom/UserGestureIndicator.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::load): Use ScriptController::processingUserGestureForMedia instead of
ScriptController::processingUserGesture
(WebCore::HTMLMediaElement::play): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (187687 => 187688)
--- trunk/Source/WebCore/ChangeLog 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/ChangeLog 2015-07-31 22:59:04 UTC (rev 187688)
@@ -1,3 +1,24 @@
+2015-07-31 Eric Carlson <[email protected]>
+
+ [iOS] use a media-specific user gesture check
+ https://bugs.webkit.org/show_bug.cgi?id=147509
+
+ Reviewed by Jer Noble.
+
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::processingUserGestureForMedia): New.
+ * bindings/js/ScriptController.h:
+
+ * dom/UserGestureIndicator.cpp:
+ (WebCore::isDefinite): Allow DefinitelyProcessingMediaUserGesture.
+ (WebCore::UserGestureIndicator::processingUserGestureForMedia): New.
+ * dom/UserGestureIndicator.h:
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::load): Use ScriptController::processingUserGestureForMedia instead of
+ ScriptController::processingUserGesture
+ (WebCore::HTMLMediaElement::play): Ditto.
+
2015-07-31 Andreas Kling <[email protected]>
Crashes under HTMLMediaElement::updateActiveTextTrackCues() when destroying CachedPage.
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (187687 => 187688)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-07-31 22:59:04 UTC (rev 187688)
@@ -306,6 +306,11 @@
return UserGestureIndicator::processingUserGesture();
}
+bool ScriptController::processingUserGestureForMedia()
+{
+ return UserGestureIndicator::processingUserGestureForMedia();
+}
+
bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
{
ExecState* exec = JSMainThreadExecState::currentState();
Modified: trunk/Source/WebCore/bindings/js/ScriptController.h (187687 => 187688)
--- trunk/Source/WebCore/bindings/js/ScriptController.h 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/bindings/js/ScriptController.h 2015-07-31 22:59:04 UTC (rev 187688)
@@ -121,6 +121,7 @@
void disableEval(const String& errorMessage);
WEBCORE_EXPORT static bool processingUserGesture();
+ WEBCORE_EXPORT static bool processingUserGestureForMedia();
static bool canAccessFromCurrentOrigin(Frame*);
WEBCORE_EXPORT bool canExecuteScripts(ReasonForCallingCanExecuteScripts);
Modified: trunk/Source/WebCore/dom/UserGestureIndicator.cpp (187687 => 187688)
--- trunk/Source/WebCore/dom/UserGestureIndicator.cpp 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/dom/UserGestureIndicator.cpp 2015-07-31 22:59:04 UTC (rev 187688)
@@ -33,7 +33,7 @@
static bool isDefinite(ProcessingUserGestureState state)
{
- return state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture;
+ return state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture || state == DefinitelyProcessingMediaUserGesture;
}
ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture;
@@ -66,4 +66,12 @@
return isMainThread() ? s_state == DefinitelyProcessingUserGesture : false;
}
+bool UserGestureIndicator::processingUserGestureForMedia()
+{
+ if (!isMainThread())
+ return false;
+
+ return s_state == DefinitelyProcessingUserGesture || s_state == DefinitelyProcessingMediaUserGesture;
}
+
+}
Modified: trunk/Source/WebCore/dom/UserGestureIndicator.h (187687 => 187688)
--- trunk/Source/WebCore/dom/UserGestureIndicator.h 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/dom/UserGestureIndicator.h 2015-07-31 22:59:04 UTC (rev 187688)
@@ -34,6 +34,7 @@
enum ProcessingUserGestureState {
DefinitelyProcessingUserGesture,
+ DefinitelyProcessingMediaUserGesture,
PossiblyProcessingUserGesture,
DefinitelyNotProcessingUserGesture
};
@@ -42,6 +43,7 @@
WTF_MAKE_NONCOPYABLE(UserGestureIndicator);
public:
static bool processingUserGesture();
+ static bool processingUserGestureForMedia();
// If a document is provided, its last known user gesture timestamp is updated.
WEBCORE_EXPORT explicit UserGestureIndicator(ProcessingUserGestureState, Document* = nullptr);
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (187687 => 187688)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2015-07-31 22:43:55 UTC (rev 187687)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2015-07-31 22:59:04 UTC (rev 187688)
@@ -920,7 +920,7 @@
if (!m_mediaSession->dataLoadingPermitted(*this))
return;
- if (ScriptController::processingUserGesture())
+ if (ScriptController::processingUserGestureForMedia())
removeBehaviorsRestrictionsAfterFirstUserGesture();
prepareForLoad();
@@ -2839,7 +2839,7 @@
if (!m_mediaSession->playbackPermitted(*this))
return;
- if (ScriptController::processingUserGesture())
+ if (ScriptController::processingUserGestureForMedia())
removeBehaviorsRestrictionsAfterFirstUserGesture();
playInternal();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes