Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| index 9156bba583b6c602b3a8cc84b4db479d0b50a85d..ea55525c2151f8473baa62865831cfcba29c1417 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| @@ -293,12 +293,27 @@ bool isDocumentCrossOrigin(Document& document) { |
| return frame && frame->isCrossOriginSubframe(); |
| } |
| +bool isDocumentWhitelisted(Document& document, const String& whitelistScope) { |
| + if (whitelistScope.isNull() || whitelistScope.isEmpty()) |
| + return false; |
| + if (whitelistScope == "*") |
| + return true; |
|
mlamouri (slow - plz ping)
2017/02/10 14:28:46
How can that happen?
Zhiqiang Zhang (Slow)
2017/02/10 14:47:11
Ah, I was thinking of when the manifest is unscope
|
| + |
| + return document.url().getString().startsWith(whitelistScope); |
| +} |
| + |
| // Return true if and only if the document settings specifies media playback |
| // requires user gesture. |
| bool computeLockedPendingUserGesture(Document& document) { |
| if (!document.settings()) |
| return false; |
| + if (isDocumentWhitelisted( |
| + document, |
| + document.settings()->getMediaPlaybackGestureWhitelistScope())) { |
|
mlamouri (slow - plz ping)
2017/02/10 14:28:46
I guess you could just pass `document` and get the
Zhiqiang Zhang (Slow)
2017/02/10 14:47:11
Done.
|
| + return false; |
| + } |
| + |
| if (document.settings()->getCrossOriginMediaPlaybackRequiresUserGesture() && |
| isDocumentCrossOrigin(document)) { |
| return true; |