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..128f32d6a155f13bd217f4be47e6d4c891e5e786 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) { |
| + DCHECK(!document.settings()); |
| + |
| + const String& whitelistScope = |
| + document.settings()->getMediaPlaybackGestureWhitelistScope(); |
| + if (whitelistScope.isNull() || whitelistScope.isEmpty()) |
| + return false; |
| + |
| + 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)) { |
| + return false; |
| + } |
|
mlamouri (slow - plz ping)
2017/02/13 12:03:15
style: drop the { }
|
| + |
| if (document.settings()->getCrossOriginMediaPlaybackRequiresUserGesture() && |
| isDocumentCrossOrigin(document)) { |
| return true; |