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

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

Issue 2075053003: Add basic Referrer-Policy support for Documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test expectation for tweaked console message Created 4 years, 6 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
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 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after
3099 return appliedViewportDescription; 3099 return appliedViewportDescription;
3100 } 3100 }
3101 3101
3102 void Document::updateViewportDescription() 3102 void Document::updateViewportDescription()
3103 { 3103 {
3104 if (frame() && frame()->isMainFrame()) { 3104 if (frame() && frame()->isMainFrame()) {
3105 frameHost()->chromeClient().dispatchViewportPropertiesDidChange(viewport Description()); 3105 frameHost()->chromeClient().dispatchViewportPropertiesDidChange(viewport Description());
3106 } 3106 }
3107 } 3107 }
3108 3108
3109 void Document::processReferrerPolicy(const String& policy)
3110 {
3111 ReferrerPolicy referrerPolicy;
3112 if (!SecurityPolicy::referrerPolicyFromString(policy, &referrerPolicy)) {
3113 addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMe ssageLevel, "Failed to set referrer policy: The value '" + policy + "' is not on e of 'always', 'default', 'never', 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-crossorigin', or 'unsafe-url'. This document's referrer p olicy has been left unchanged."));
3114 return;
3115 }
3116
3117 setReferrerPolicy(referrerPolicy);
3118 }
3119
3120 String Document::outgoingReferrer() const 3109 String Document::outgoingReferrer() const
3121 { 3110 {
3122 if (getSecurityOrigin()->isUnique()) { 3111 if (getSecurityOrigin()->isUnique()) {
3123 // Return |no-referrer|. 3112 // Return |no-referrer|.
3124 return String(); 3113 return String();
3125 } 3114 }
3126 3115
3127 // See http://www.whatwg.org/specs/web-apps/current-work/#fetching-resources 3116 // See http://www.whatwg.org/specs/web-apps/current-work/#fetching-resources
3128 // for why we walk the parent chain for srcdoc documents. 3117 // for why we walk the parent chain for srcdoc documents.
3129 const Document* referrerDocument = this; 3118 const Document* referrerDocument = this;
(...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after
6020 } 6009 }
6021 6010
6022 void showLiveDocumentInstances() 6011 void showLiveDocumentInstances()
6023 { 6012 {
6024 WeakDocumentSet& set = liveDocumentSet(); 6013 WeakDocumentSet& set = liveDocumentSet();
6025 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6014 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6026 for (Document* document : set) 6015 for (Document* document : set)
6027 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6016 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6028 } 6017 }
6029 #endif 6018 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698