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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 607433002: Referrer Policy: Update <meta name="referrer"> values to match the spec. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tests. Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/http/tests/security/referrer-policy-no-referrer-when-downgrade-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after
3155 { 3155 {
3156 if (frame() && frame()->isMainFrame()) { 3156 if (frame() && frame()->isMainFrame()) {
3157 frameHost()->chrome().dispatchViewportPropertiesDidChange(m_viewportDesc ription); 3157 frameHost()->chrome().dispatchViewportPropertiesDidChange(m_viewportDesc ription);
3158 } 3158 }
3159 } 3159 }
3160 3160
3161 void Document::processReferrerPolicy(const String& policy) 3161 void Document::processReferrerPolicy(const String& policy)
3162 { 3162 {
3163 ASSERT(!policy.isNull()); 3163 ASSERT(!policy.isNull());
3164 3164
3165 if (equalIgnoringCase(policy, "never")) { 3165 if (equalIgnoringCase(policy, "no-referrer") || equalIgnoringCase(policy, "n ever")) {
3166 setReferrerPolicy(ReferrerPolicyNever); 3166 setReferrerPolicy(ReferrerPolicyNever);
3167 } else if (equalIgnoringCase(policy, "always")) { 3167 } else if (equalIgnoringCase(policy, "unsafe-url") || equalIgnoringCase(poli cy, "always")) {
3168 setReferrerPolicy(ReferrerPolicyAlways); 3168 setReferrerPolicy(ReferrerPolicyAlways);
3169 } else if (equalIgnoringCase(policy, "origin")) { 3169 } else if (equalIgnoringCase(policy, "origin")) {
3170 setReferrerPolicy(ReferrerPolicyOrigin); 3170 setReferrerPolicy(ReferrerPolicyOrigin);
3171 } else if (equalIgnoringCase(policy, "default")) { 3171 } else if (equalIgnoringCase(policy, "no-referrer-when-downgrade") || equalI gnoringCase(policy, "default")) {
3172 setReferrerPolicy(ReferrerPolicyDefault); 3172 setReferrerPolicy(ReferrerPolicyDefault);
3173 } else { 3173 } else {
3174 addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMe ssageLevel, "Failed to set referrer policy: The value '" + policy + "' is not on e of 'always', 'default', 'never', or 'origin'. Defaulting to 'never'.")); 3174 addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMe ssageLevel, "Failed to set referrer policy: The value '" + policy + "' is not on e of 'no-referrer', 'origin', 'no-referrer-when-downgrade', or 'unsafe-url'. Def aulting to 'no-referrer'."));
3175 setReferrerPolicy(ReferrerPolicyNever); 3175 setReferrerPolicy(ReferrerPolicyNever);
3176 } 3176 }
3177 } 3177 }
3178 3178
3179 void Document::setReferrerPolicy(ReferrerPolicy referrerPolicy) 3179 void Document::setReferrerPolicy(ReferrerPolicy referrerPolicy)
3180 { 3180 {
3181 // FIXME: Can we adopt the CSP referrer policy merge algorithm? Or does the web rely on being able to modify the referrer policy in-flight? 3181 // FIXME: Can we adopt the CSP referrer policy merge algorithm? Or does the web rely on being able to modify the referrer policy in-flight?
3182 if (m_didSetReferrerPolicy) 3182 if (m_didSetReferrerPolicy)
3183 UseCounter::count(this, UseCounter::ResetReferrerPolicy); 3183 UseCounter::count(this, UseCounter::ResetReferrerPolicy);
3184 m_didSetReferrerPolicy = true; 3184 m_didSetReferrerPolicy = true;
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after
5854 using namespace blink; 5854 using namespace blink;
5855 void showLiveDocumentInstances() 5855 void showLiveDocumentInstances()
5856 { 5856 {
5857 WeakDocumentSet& set = liveDocumentSet(); 5857 WeakDocumentSet& set = liveDocumentSet();
5858 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5858 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5859 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5859 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5860 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5860 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5861 } 5861 }
5862 } 5862 }
5863 #endif 5863 #endif
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/security/referrer-policy-no-referrer-when-downgrade-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698