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

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

Issue 2075053003: Add basic Referrer-Policy support for Documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add crbug for TODO 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) 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "core/page/ChromeClient.h" 78 #include "core/page/ChromeClient.h"
79 #include "core/page/CreateWindow.h" 79 #include "core/page/CreateWindow.h"
80 #include "core/page/FrameTree.h" 80 #include "core/page/FrameTree.h"
81 #include "core/page/Page.h" 81 #include "core/page/Page.h"
82 #include "core/page/WindowFeatures.h" 82 #include "core/page/WindowFeatures.h"
83 #include "core/page/scrolling/ScrollingCoordinator.h" 83 #include "core/page/scrolling/ScrollingCoordinator.h"
84 #include "core/svg/graphics/SVGImage.h" 84 #include "core/svg/graphics/SVGImage.h"
85 #include "core/xml/parser/XMLDocumentParser.h" 85 #include "core/xml/parser/XMLDocumentParser.h"
86 #include "platform/Logging.h" 86 #include "platform/Logging.h"
87 #include "platform/PluginScriptForbiddenScope.h" 87 #include "platform/PluginScriptForbiddenScope.h"
88 #include "platform/RuntimeEnabledFeatures.h"
88 #include "platform/ScriptForbiddenScope.h" 89 #include "platform/ScriptForbiddenScope.h"
89 #include "platform/TraceEvent.h" 90 #include "platform/TraceEvent.h"
90 #include "platform/UserGestureIndicator.h" 91 #include "platform/UserGestureIndicator.h"
91 #include "platform/network/HTTPParsers.h" 92 #include "platform/network/HTTPParsers.h"
92 #include "platform/network/ResourceRequest.h" 93 #include "platform/network/ResourceRequest.h"
93 #include "platform/scroll/ScrollAnimatorBase.h" 94 #include "platform/scroll/ScrollAnimatorBase.h"
94 #include "platform/weborigin/SecurityOrigin.h" 95 #include "platform/weborigin/SecurityOrigin.h"
95 #include "platform/weborigin/SecurityPolicy.h" 96 #include "platform/weborigin/SecurityPolicy.h"
96 #include "platform/weborigin/Suborigin.h" 97 #include "platform/weborigin/Suborigin.h"
97 #include "public/platform/WebCachePolicy.h" 98 #include "public/platform/WebCachePolicy.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 size_t commaIndex = headerContentLanguage.find(','); 508 size_t commaIndex = headerContentLanguage.find(',');
508 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate 509 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate
509 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>); 510 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>);
510 if (!headerContentLanguage.isEmpty()) 511 if (!headerContentLanguage.isEmpty())
511 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage)); 512 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage));
512 } 513 }
513 514
514 OriginTrialContext::addTokensFromHeader(m_frame->document(), m_documentL oader->response().httpHeaderField(HTTPNames::Origin_Trial)); 515 OriginTrialContext::addTokensFromHeader(m_frame->document(), m_documentL oader->response().httpHeaderField(HTTPNames::Origin_Trial));
515 } 516 }
516 517
518 if (m_documentLoader && RuntimeEnabledFeatures::referrerPolicyHeaderEnabled( )) {
519 String referrerPolicyHeader = m_documentLoader->response().httpHeaderFie ld(HTTPNames::Referrer_Policy);
520 if (!referrerPolicyHeader.isNull()) {
521 ReferrerPolicy referrerPolicy = parseReferrerPolicyHeader(referrerPo licyHeader);
Mike West 2016/06/21 07:40:03 Could you call `Document::processReferrerPolicy(re
estark 2016/06/21 17:41:33 Hmm. If I put the new parsing code in Document::pr
Mike West 2016/06/22 18:57:04 I trust your judgement. I think it's probably reas
522 if (referrerPolicy != ReferrerPolicyDefault) {
523 m_frame->document()->setReferrerPolicy(referrerPolicy);
524 }
525 }
526 }
527
517 client()->didCreateNewDocument(); 528 client()->didCreateNewDocument();
518 } 529 }
519 530
520 void FrameLoader::finishedParsing() 531 void FrameLoader::finishedParsing()
521 { 532 {
522 if (m_stateMachine.creatingInitialEmptyDocument()) 533 if (m_stateMachine.creatingInitialEmptyDocument())
523 return; 534 return;
524 535
525 m_progressTracker->finishedParsing(); 536 m_progressTracker->finishedParsing();
526 537
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String()); 1623 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String());
1613 return tracedValue; 1624 return tracedValue;
1614 } 1625 }
1615 1626
1616 inline void FrameLoader::takeObjectSnapshot() const 1627 inline void FrameLoader::takeObjectSnapshot() const
1617 { 1628 {
1618 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value()); 1629 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value());
1619 } 1630 }
1620 1631
1621 } // namespace blink 1632 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698