Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: Source/core/dom/Document.cpp

Issue 1148603002: Anchor element's referrer attribute implementation for Referrer Policy Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove debug logging. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/HTMLAnchorElement.cpp » ('j') | Source/core/html/HTMLAnchorElement.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 84b04d9fcf18517c3e277134cf1f6f9e12203036..24ecb495e9795d1cd2f697b85f063656c60bea87 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3078,16 +3078,9 @@ void Document::processReferrerPolicy(const String& policy)
{
ASSERT(!policy.isNull());
- if (equalIgnoringCase(policy, "no-referrer") || equalIgnoringCase(policy, "never"))
- setReferrerPolicy(ReferrerPolicyNever);
- else if (equalIgnoringCase(policy, "unsafe-url") || equalIgnoringCase(policy, "always"))
- setReferrerPolicy(ReferrerPolicyAlways);
- else if (equalIgnoringCase(policy, "origin"))
- setReferrerPolicy(ReferrerPolicyOrigin);
- else if (equalIgnoringCase(policy, "origin-when-cross-origin") || equalIgnoringCase(policy, "origin-when-crossorigin"))
- setReferrerPolicy(ReferrerPolicyOriginWhenCrossOrigin);
- else if (equalIgnoringCase(policy, "no-referrer-when-downgrade") || equalIgnoringCase(policy, "default"))
- setReferrerPolicy(ReferrerPolicyNoReferrerWhenDowngrade);
+ ReferrerPolicy referrerPolicy;
+ if (ParseReferrerPolicy(policy, &referrerPolicy))
+ setReferrerPolicy(referrerPolicy);
else
addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMessageLevel, "Failed to set referrer policy: The value '" + policy + "' is not one of 'always', 'default', 'never', 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-crossorigin', or 'unsafe-url'. This document's referrer policy has been left unchanged."));
}
« no previous file with comments | « no previous file | Source/core/html/HTMLAnchorElement.cpp » ('j') | Source/core/html/HTMLAnchorElement.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698