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

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

Issue 2254533002: [FeaturePolicy] Initial implementation of Feature Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fp-flag
Patch Set: Conform to JFV spec for header format Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #include "core/page/CreateWindow.h" 80 #include "core/page/CreateWindow.h"
81 #include "core/page/FrameTree.h" 81 #include "core/page/FrameTree.h"
82 #include "core/page/Page.h" 82 #include "core/page/Page.h"
83 #include "core/page/WindowFeatures.h" 83 #include "core/page/WindowFeatures.h"
84 #include "core/page/scrolling/ScrollingCoordinator.h" 84 #include "core/page/scrolling/ScrollingCoordinator.h"
85 #include "core/svg/graphics/SVGImage.h" 85 #include "core/svg/graphics/SVGImage.h"
86 #include "core/xml/parser/XMLDocumentParser.h" 86 #include "core/xml/parser/XMLDocumentParser.h"
87 #include "platform/PluginScriptForbiddenScope.h" 87 #include "platform/PluginScriptForbiddenScope.h"
88 #include "platform/ScriptForbiddenScope.h" 88 #include "platform/ScriptForbiddenScope.h"
89 #include "platform/UserGestureIndicator.h" 89 #include "platform/UserGestureIndicator.h"
90 #include "platform/feature_policy/FeaturePolicy.h"
90 #include "platform/network/HTTPParsers.h" 91 #include "platform/network/HTTPParsers.h"
91 #include "platform/network/ResourceRequest.h" 92 #include "platform/network/ResourceRequest.h"
92 #include "platform/scroll/ScrollAnimatorBase.h" 93 #include "platform/scroll/ScrollAnimatorBase.h"
93 #include "platform/tracing/TraceEvent.h" 94 #include "platform/tracing/TraceEvent.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"
98 #include "public/platform/WebURLRequest.h" 99 #include "public/platform/WebURLRequest.h"
99 #include "wtf/AutoReset.h" 100 #include "wtf/AutoReset.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 headerContentLanguage.stripWhiteSpace(isHTMLSpace<UChar>); 575 headerContentLanguage.stripWhiteSpace(isHTMLSpace<UChar>);
575 if (!headerContentLanguage.isEmpty()) { 576 if (!headerContentLanguage.isEmpty()) {
576 m_frame->document()->setContentLanguage( 577 m_frame->document()->setContentLanguage(
577 AtomicString(headerContentLanguage)); 578 AtomicString(headerContentLanguage));
578 } 579 }
579 } 580 }
580 581
581 OriginTrialContext::addTokensFromHeader( 582 OriginTrialContext::addTokensFromHeader(
582 m_frame->document(), 583 m_frame->document(),
583 m_documentLoader->response().httpHeaderField(HTTPNames::Origin_Trial)); 584 m_documentLoader->response().httpHeaderField(HTTPNames::Origin_Trial));
585 if (RuntimeEnabledFeatures::featurePolicyEnabled()) {
586 FeaturePolicy* featurePolicy = FeaturePolicy::createFromParentPolicy(
587 (isLoadingMainFrame()
588 ? nullptr
589 : m_frame->client()->parent()->getFeaturePolicy()),
590 m_frame->securityContext()->getSecurityOrigin());
591 featurePolicy->setHeaderPolicy(
592 m_documentLoader->response().httpHeaderField(
593 HTTPNames::Feature_Policy));
594 m_frame->setFeaturePolicy(featurePolicy);
595 }
584 } 596 }
585 597
586 if (m_documentLoader) { 598 if (m_documentLoader) {
587 String referrerPolicyHeader = m_documentLoader->response().httpHeaderField( 599 String referrerPolicyHeader = m_documentLoader->response().httpHeaderField(
588 HTTPNames::Referrer_Policy); 600 HTTPNames::Referrer_Policy);
589 if (!referrerPolicyHeader.isNull()) { 601 if (!referrerPolicyHeader.isNull()) {
590 m_frame->document()->parseAndSetReferrerPolicy(referrerPolicyHeader); 602 m_frame->document()->parseAndSetReferrerPolicy(referrerPolicyHeader);
591 } 603 }
592 } 604 }
593 605
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 m_documentLoader ? m_documentLoader->url() : String()); 1928 m_documentLoader ? m_documentLoader->url() : String());
1917 return tracedValue; 1929 return tracedValue;
1918 } 1930 }
1919 1931
1920 inline void FrameLoader::takeObjectSnapshot() const { 1932 inline void FrameLoader::takeObjectSnapshot() const {
1921 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1933 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1922 toTracedValue()); 1934 toTracedValue());
1923 } 1935 }
1924 1936
1925 } // namespace blink 1937 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698