| Index: third_party/WebKit/Source/core/dom/ExecutionContext.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
|
| index 60a65d4167ebcc6bf180365b6f94d7729ee9ce0e..149cd19ff7be676ed587f3f375502f10e036290a 100644
|
| --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
|
| @@ -193,22 +193,13 @@ String ExecutionContext::outgoingReferrer() const {
|
|
|
| void ExecutionContext::parseAndSetReferrerPolicy(const String& policies,
|
| bool supportLegacyKeywords) {
|
| - ReferrerPolicy referrerPolicy = ReferrerPolicyDefault;
|
| -
|
| - Vector<String> tokens;
|
| - policies.split(',', true, tokens);
|
| - for (const auto& token : tokens) {
|
| - ReferrerPolicy currentResult;
|
| - if ((supportLegacyKeywords
|
| - ? SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(
|
| - token, ¤tResult)
|
| - : SecurityPolicy::referrerPolicyFromString(token,
|
| - ¤tResult))) {
|
| - referrerPolicy = currentResult;
|
| - }
|
| - }
|
| + ReferrerPolicy referrerPolicy;
|
|
|
| - if (referrerPolicy == ReferrerPolicyDefault) {
|
| + if (!SecurityPolicy::referrerPolicyFromHeaderValue(
|
| + policies,
|
| + supportLegacyKeywords ? SupportReferrerPolicyLegacyKeywords
|
| + : DoNotSupportReferrerPolicyLegacyKeywords,
|
| + &referrerPolicy)) {
|
| addConsoleMessage(ConsoleMessage::create(
|
| RenderingMessageSource, ErrorMessageLevel,
|
| "Failed to set referrer policy: The value '" + policies +
|
|
|