OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web/WebRemoteFrameImpl.h" | 5 #include "web/WebRemoteFrameImpl.h" |
6 | 6 |
| 7 #include <v8/include/v8.h> |
7 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
8 #include "bindings/core/v8/WindowProxy.h" | 9 #include "bindings/core/v8/WindowProxy.h" |
9 #include "core/dom/Fullscreen.h" | 10 #include "core/dom/Fullscreen.h" |
10 #include "core/dom/RemoteSecurityContext.h" | 11 #include "core/dom/RemoteSecurityContext.h" |
11 #include "core/dom/SecurityContext.h" | 12 #include "core/dom/SecurityContext.h" |
12 #include "core/frame/FrameView.h" | 13 #include "core/frame/FrameView.h" |
13 #include "core/frame/Settings.h" | 14 #include "core/frame/Settings.h" |
14 #include "core/frame/csp/ContentSecurityPolicy.h" | 15 #include "core/frame/csp/ContentSecurityPolicy.h" |
15 #include "core/html/HTMLFrameOwnerElement.h" | 16 #include "core/html/HTMLFrameOwnerElement.h" |
16 #include "core/layout/LayoutObject.h" | 17 #include "core/layout/LayoutObject.h" |
17 #include "core/page/Page.h" | 18 #include "core/page/Page.h" |
| 19 #include "platform/feature_policy/FeaturePolicy.h" |
18 #include "platform/heap/Handle.h" | 20 #include "platform/heap/Handle.h" |
19 #include "public/platform/WebFeaturePolicy.h" | 21 #include "public/platform/WebFeaturePolicy.h" |
20 #include "public/platform/WebFloatRect.h" | 22 #include "public/platform/WebFloatRect.h" |
21 #include "public/platform/WebRect.h" | 23 #include "public/platform/WebRect.h" |
22 #include "public/web/WebDocument.h" | 24 #include "public/web/WebDocument.h" |
23 #include "public/web/WebFrameOwnerProperties.h" | 25 #include "public/web/WebFrameOwnerProperties.h" |
24 #include "public/web/WebPerformance.h" | 26 #include "public/web/WebPerformance.h" |
25 #include "public/web/WebRange.h" | 27 #include "public/web/WebRange.h" |
26 #include "public/web/WebTreeScopeType.h" | 28 #include "public/web/WebTreeScopeType.h" |
27 #include "v8/include/v8.h" | 29 #include "v8/include/v8.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 426 } |
425 | 427 |
426 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader( | 428 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader( |
427 const WebParsedFeaturePolicy& parsedHeader) const { | 429 const WebParsedFeaturePolicy& parsedHeader) const { |
428 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { | 430 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { |
429 WebFeaturePolicy* parentFeaturePolicy = nullptr; | 431 WebFeaturePolicy* parentFeaturePolicy = nullptr; |
430 if (parent()) { | 432 if (parent()) { |
431 Frame* parentFrame = frame()->client()->parent(); | 433 Frame* parentFrame = frame()->client()->parent(); |
432 parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy(); | 434 parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy(); |
433 } | 435 } |
434 frame()->securityContext()->initializeFeaturePolicy(parsedHeader, | 436 const WebParsedFeaturePolicy containerPolicy = |
435 parentFeaturePolicy); | 437 getContainerPolicyFromAllowedFeatures( |
| 438 frame()->owner()->allowedFeatures(), |
| 439 frame()->securityContext()->getSecurityOrigin()); |
| 440 frame()->securityContext()->initializeFeaturePolicy( |
| 441 parsedHeader, containerPolicy, parentFeaturePolicy); |
436 } | 442 } |
437 } | 443 } |
438 | 444 |
439 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( | 445 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( |
440 const WebString& headerValue, | 446 const WebString& headerValue, |
441 WebContentSecurityPolicyType type, | 447 WebContentSecurityPolicyType type, |
442 WebContentSecurityPolicySource source) const { | 448 WebContentSecurityPolicySource source) const { |
443 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( | 449 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( |
444 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), | 450 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), |
445 static_cast<ContentSecurityPolicyHeaderSource>(source)); | 451 static_cast<ContentSecurityPolicyHeaderSource>(source)); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 537 } |
532 | 538 |
533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 539 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
534 WebRemoteFrameClient* client) | 540 WebRemoteFrameClient* client) |
535 : WebRemoteFrame(scope), | 541 : WebRemoteFrame(scope), |
536 m_frameClient(RemoteFrameClientImpl::create(this)), | 542 m_frameClient(RemoteFrameClientImpl::create(this)), |
537 m_client(client), | 543 m_client(client), |
538 m_selfKeepAlive(this) {} | 544 m_selfKeepAlive(this) {} |
539 | 545 |
540 } // namespace blink | 546 } // namespace blink |
OLD | NEW |