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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Fix ODR violation Created 3 years, 8 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 LocalFrame* frame = document->frame(); 1006 LocalFrame* frame = document->frame();
1007 WebFeaturePolicy* parentFeaturePolicy = 1007 WebFeaturePolicy* parentFeaturePolicy =
1008 frame->isMainFrame() 1008 frame->isMainFrame()
1009 ? nullptr 1009 ? nullptr
1010 : frame->tree().parent()->securityContext()->getFeaturePolicy(); 1010 : frame->tree().parent()->securityContext()->getFeaturePolicy();
1011 Vector<String> messages; 1011 Vector<String> messages;
1012 const WebParsedFeaturePolicy& parsedHeader = parseFeaturePolicy( 1012 const WebParsedFeaturePolicy& parsedHeader = parseFeaturePolicy(
1013 featurePolicyHeader, frame->securityContext()->getSecurityOrigin(), 1013 featurePolicyHeader, frame->securityContext()->getSecurityOrigin(),
1014 &messages); 1014 &messages);
1015 WebParsedFeaturePolicy containerPolicy; 1015 WebParsedFeaturePolicy containerPolicy;
1016 if (frame->owner()) { 1016 if (frame->owner())
1017 containerPolicy = getContainerPolicyFromAllowedFeatures( 1017 containerPolicy = frame->owner()->containerPolicy();
1018 frame->owner()->allowedFeatures(),
1019 frame->securityContext()->getSecurityOrigin());
1020 }
1021 frame->securityContext()->initializeFeaturePolicy( 1018 frame->securityContext()->initializeFeaturePolicy(
1022 parsedHeader, containerPolicy, parentFeaturePolicy); 1019 parsedHeader, containerPolicy, parentFeaturePolicy);
1023 1020
1024 for (auto& message : messages) { 1021 for (auto& message : messages) {
1025 document->addConsoleMessage( 1022 document->addConsoleMessage(
1026 ConsoleMessage::create(OtherMessageSource, ErrorMessageLevel, 1023 ConsoleMessage::create(OtherMessageSource, ErrorMessageLevel,
1027 "Error with Feature-Policy header: " + message)); 1024 "Error with Feature-Policy header: " + message));
1028 } 1025 }
1029 if (!parsedHeader.isEmpty()) 1026 if (!parsedHeader.isEmpty())
1030 frame->client()->didSetFeaturePolicyHeader(parsedHeader); 1027 frame->client()->didSetFeaturePolicyHeader(parsedHeader);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 InstallNewDocumentReason::kJavascriptURL, 1079 InstallNewDocumentReason::kJavascriptURL,
1083 ForceSynchronousParsing, KURL()); 1080 ForceSynchronousParsing, KURL());
1084 if (!source.isNull()) 1081 if (!source.isNull())
1085 m_writer->appendReplacingData(source); 1082 m_writer->appendReplacingData(source);
1086 endWriting(); 1083 endWriting();
1087 } 1084 }
1088 1085
1089 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1086 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1090 1087
1091 } // namespace blink 1088 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698