CSP: Add app-specific workaround for Ecobee and Quora
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2016 16:48:59 +0000 (16:48 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2016 16:48:59 +0000 (16:48 +0000)
commit1f286c7687b064fc689ef734506ae5b9e7ee4194
tree35b9a0d728fbe5d92bb4878b46edae04baac64ca
parentae910a3053f333dda7bb4d7033ee9f597ed1cd72
CSP: Add app-specific workaround for Ecobee and Quora
https://bugs.webkit.org/show_bug.cgi?id=157005
<rdar://problem/25560776>

Reviewed by Brent Fulgham.

Source/WebCore:

* page/Settings.in: Add setting allowContentSecurityPolicySourceStarToMatchAnyProtocol (disabled by default).
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Modified to return true
if ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol() evaluates to true.
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isEcobee): Added.
(WebCore::IOSApplication::isQuora): Added.

Source/WebKit/mac:

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
(-[WebView _preferencesChanged:]): Enable setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
if applicable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.in
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.h
Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebCore/platform/RuntimeApplicationChecks.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitVersionChecks.h
Source/WebKit/mac/WebView/WebView.mm