| OLD | NEW |
| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 LocalFrame* frame = document->GetFrame(); | 1007 LocalFrame* frame = document->GetFrame(); |
| 1008 WebFeaturePolicy* parent_feature_policy = | 1008 WebFeaturePolicy* parent_feature_policy = |
| 1009 frame->IsMainFrame() | 1009 frame->IsMainFrame() |
| 1010 ? nullptr | 1010 ? nullptr |
| 1011 : frame->Tree().Parent()->GetSecurityContext()->GetFeaturePolicy(); | 1011 : frame->Tree().Parent()->GetSecurityContext()->GetFeaturePolicy(); |
| 1012 Vector<String> messages; | 1012 Vector<String> messages; |
| 1013 const WebParsedFeaturePolicy& parsed_header = ParseFeaturePolicy( | 1013 const WebParsedFeaturePolicy& parsed_header = ParseFeaturePolicy( |
| 1014 feature_policy_header, frame->GetSecurityContext()->GetSecurityOrigin(), | 1014 feature_policy_header, frame->GetSecurityContext()->GetSecurityOrigin(), |
| 1015 &messages); | 1015 &messages); |
| 1016 WebParsedFeaturePolicy container_policy; | 1016 WebParsedFeaturePolicy container_policy; |
| 1017 if (frame->Owner()) { | 1017 if (frame->Owner()) |
| 1018 container_policy = GetContainerPolicyFromAllowedFeatures( | 1018 container_policy = frame->Owner()->ContainerPolicy(); |
| 1019 frame->Owner()->AllowedFeatures(), | |
| 1020 frame->GetSecurityContext()->GetSecurityOrigin()); | |
| 1021 } | |
| 1022 frame->GetSecurityContext()->InitializeFeaturePolicy( | 1019 frame->GetSecurityContext()->InitializeFeaturePolicy( |
| 1023 parsed_header, container_policy, parent_feature_policy); | 1020 parsed_header, container_policy, parent_feature_policy); |
| 1024 | 1021 |
| 1025 for (auto& message : messages) { | 1022 for (auto& message : messages) { |
| 1026 document->AddConsoleMessage( | 1023 document->AddConsoleMessage( |
| 1027 ConsoleMessage::Create(kOtherMessageSource, kErrorMessageLevel, | 1024 ConsoleMessage::Create(kOtherMessageSource, kErrorMessageLevel, |
| 1028 "Error with Feature-Policy header: " + message)); | 1025 "Error with Feature-Policy header: " + message)); |
| 1029 } | 1026 } |
| 1030 if (!parsed_header.empty()) | 1027 if (!parsed_header.empty()) |
| 1031 frame->Client()->DidSetFeaturePolicyHeader(parsed_header); | 1028 frame->Client()->DidSetFeaturePolicyHeader(parsed_header); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 InstallNewDocumentReason::kJavascriptURL, | 1111 InstallNewDocumentReason::kJavascriptURL, |
| 1115 kForceSynchronousParsing, KURL()); | 1112 kForceSynchronousParsing, KURL()); |
| 1116 if (!source.IsNull()) | 1113 if (!source.IsNull()) |
| 1117 writer_->AppendReplacingData(source); | 1114 writer_->AppendReplacingData(source); |
| 1118 EndWriting(); | 1115 EndWriting(); |
| 1119 } | 1116 } |
| 1120 | 1117 |
| 1121 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1118 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1122 | 1119 |
| 1123 } // namespace blink | 1120 } // namespace blink |
| OLD | NEW |