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

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

Issue 650023003: Make generateReferrerHeader() return a Referrer instead of a String (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « Source/core/loader/FrameFetchContext.cpp ('k') | Source/core/loader/PrerenderHandle.cpp » ('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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 if (!originDocument) 623 if (!originDocument)
624 return; 624 return;
625 // FIXME: This should be an assertion, but there's some plugin code in the c hromium repo 625 // FIXME: This should be an assertion, but there's some plugin code in the c hromium repo
626 // that both determines its own referrer and expects to be associated with a n originDocument. 626 // that both determines its own referrer and expects to be associated with a n originDocument.
627 if (!request.httpReferrer().isEmpty()) 627 if (!request.httpReferrer().isEmpty())
628 return; 628 return;
629 if (shouldSendReferrer == NeverSendReferrer) 629 if (shouldSendReferrer == NeverSendReferrer)
630 return; 630 return;
631 631
632 // Always use the initiating document to generate the referrer. 632 // Always use the initiating document to generate the referrer.
633 // We need to generateReferrerHeader(), because we haven't enforced Referrer Policy or https->http 633 // We need to generateReferrer(), because we haven't enforced ReferrerPolicy or https->http
634 // referrer suppression yet. 634 // referrer suppression yet.
635 String referrer = SecurityPolicy::generateReferrerHeader(originDocument->ref errerPolicy(), request.url(), originDocument->outgoingReferrer()); 635 Referrer referrer = SecurityPolicy::generateReferrer(originDocument->referre rPolicy(), request.url(), originDocument->outgoingReferrer());
636 636
637 request.setHTTPReferrer(Referrer(referrer, originDocument->referrerPolicy()) ); 637 request.setHTTPReferrer(referrer);
638 RefPtr<SecurityOrigin> referrerOrigin = SecurityOrigin::createFromString(ref errer); 638 RefPtr<SecurityOrigin> referrerOrigin = SecurityOrigin::createFromString(ref errer.referrer);
639 request.addHTTPOriginIfNeeded(referrerOrigin->toAtomicString()); 639 request.addHTTPOriginIfNeeded(referrerOrigin->toAtomicString());
640 } 640 }
641 641
642 bool FrameLoader::isScriptTriggeredFormSubmissionInChildFrame(const FrameLoadReq uest& request) const 642 bool FrameLoader::isScriptTriggeredFormSubmissionInChildFrame(const FrameLoadReq uest& request) const
643 { 643 {
644 // If this is a child frame and the form submission was triggered by a scrip t, lock the back/forward list 644 // If this is a child frame and the form submission was triggered by a scrip t, lock the back/forward list
645 // to match IE and Opera. 645 // to match IE and Opera.
646 // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motiva tion for this. 646 // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motiva tion for this.
647 if (!m_frame->tree().parent() || UserGestureIndicator::processingUserGesture ()) 647 if (!m_frame->tree().parent() || UserGestureIndicator::processingUserGesture ())
648 return false; 648 return false;
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1443 Frame* parentFrame = m_frame->tree().parent(); 1443 Frame* parentFrame = m_frame->tree().parent();
1444 if (parentFrame && parentFrame->isLocalFrame()) 1444 if (parentFrame && parentFrame->isLocalFrame())
1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1446 if (FrameOwner* frameOwner = m_frame->owner()) 1446 if (FrameOwner* frameOwner = m_frame->owner())
1447 flags |= frameOwner->sandboxFlags(); 1447 flags |= frameOwner->sandboxFlags();
1448 return flags; 1448 return flags;
1449 } 1449 }
1450 1450
1451 } // namespace blink 1451 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | Source/core/loader/PrerenderHandle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698