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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 1253413003: Implement referrerpolicy attribute for anchor elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update webexposed layout tests Created 5 years, 4 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
« no previous file with comments | « Source/core/html/HTMLAttributeNames.in ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 698
699 checkCompleted(); 699 checkCompleted();
700 700
701 m_frame->localDOMWindow()->statePopped(stateObject ? stateObject : Serialize dScriptValue::nullValue()); 701 m_frame->localDOMWindow()->statePopped(stateObject ? stateObject : Serialize dScriptValue::nullValue());
702 } 702 }
703 703
704 void FrameLoader::setReferrerForFrameRequest(ResourceRequest& request, ShouldSen dReferrer shouldSendReferrer, Document* originDocument) 704 void FrameLoader::setReferrerForFrameRequest(ResourceRequest& request, ShouldSen dReferrer shouldSendReferrer, Document* originDocument)
705 { 705 {
706 if (!originDocument) 706 if (!originDocument)
707 return; 707 return;
708 // FIXME: This should be an assertion, but there's some plugin code in the c hromium repo 708 // Anchor elements with the 'referrerpolicy' attribute will have
709 // that both determines its own referrer and expects to be associated with a n originDocument. 709 // already set the referrer on the request.
710 if (!request.httpReferrer().isEmpty()) 710 if (request.didSetHTTPReferrer())
711 return; 711 return;
712 if (shouldSendReferrer == NeverSendReferrer) 712 if (shouldSendReferrer == NeverSendReferrer)
713 return; 713 return;
714 714
715 // Always use the initiating document to generate the referrer. 715 // Always use the initiating document to generate the referrer.
716 // We need to generateReferrer(), because we haven't enforced ReferrerPolicy or https->http 716 // We need to generateReferrer(), because we haven't enforced ReferrerPolicy or https->http
717 // referrer suppression yet. 717 // referrer suppression yet.
718 Referrer referrer = SecurityPolicy::generateReferrer(originDocument->referre rPolicy(), request.url(), originDocument->outgoingReferrer()); 718 Referrer referrer = SecurityPolicy::generateReferrer(originDocument->referre rPolicy(), request.url(), originDocument->outgoingReferrer());
719 719
720 request.setHTTPReferrer(referrer); 720 request.setHTTPReferrer(referrer);
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 // FIXME: We need a way to propagate insecure requests policy flags to 1499 // FIXME: We need a way to propagate insecure requests policy flags to
1500 // out-of-process frames. For now, we'll always use default behavior. 1500 // out-of-process frames. For now, we'll always use default behavior.
1501 if (!parentFrame->isLocalFrame()) 1501 if (!parentFrame->isLocalFrame())
1502 return nullptr; 1502 return nullptr;
1503 1503
1504 ASSERT(toLocalFrame(parentFrame)->document()); 1504 ASSERT(toLocalFrame(parentFrame)->document());
1505 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1505 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1506 } 1506 }
1507 1507
1508 } // namespace blink 1508 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAttributeNames.in ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698