| 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 "core/dom/Fullscreen.h" | 7 #include "core/dom/Fullscreen.h" |
| 8 #include "core/dom/RemoteSecurityContext.h" | 8 #include "core/dom/RemoteSecurityContext.h" |
| 9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 frame()->securityContext()->enforceSandboxFlags( | 425 frame()->securityContext()->enforceSandboxFlags( |
| 426 static_cast<SandboxFlags>(flags)); | 426 static_cast<SandboxFlags>(flags)); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, | 429 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, |
| 430 const WebString& uniqueName) const { | 430 const WebString& uniqueName) const { |
| 431 DCHECK(frame()); | 431 DCHECK(frame()); |
| 432 frame()->tree().setPrecalculatedName(name, uniqueName); | 432 frame()->tree().setPrecalculatedName(name, uniqueName); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader( |
| 436 const WebString& headerValue) const { |
| 437 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { |
| 438 SecurityContext* parentSecurityContext = nullptr; |
| 439 if (parent()) { |
| 440 Frame* parentFrame = frame()->client()->parent(); |
| 441 parentSecurityContext = parentFrame->securityContext(); |
| 442 } |
| 443 frame()->securityContext()->setFeaturePolicyFromHeader( |
| 444 headerValue, parentSecurityContext); |
| 445 } |
| 446 } |
| 447 |
| 435 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( | 448 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( |
| 436 const WebString& headerValue, | 449 const WebString& headerValue, |
| 437 WebContentSecurityPolicyType type, | 450 WebContentSecurityPolicyType type, |
| 438 WebContentSecurityPolicySource source) const { | 451 WebContentSecurityPolicySource source) const { |
| 439 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( | 452 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( |
| 440 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), | 453 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), |
| 441 static_cast<ContentSecurityPolicyHeaderSource>(source)); | 454 static_cast<ContentSecurityPolicyHeaderSource>(source)); |
| 442 } | 455 } |
| 443 | 456 |
| 444 void WebRemoteFrameImpl::resetReplicatedContentSecurityPolicy() const { | 457 void WebRemoteFrameImpl::resetReplicatedContentSecurityPolicy() const { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 529 } |
| 517 | 530 |
| 518 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 531 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
| 519 WebRemoteFrameClient* client) | 532 WebRemoteFrameClient* client) |
| 520 : WebRemoteFrame(scope), | 533 : WebRemoteFrame(scope), |
| 521 m_frameClient(RemoteFrameClientImpl::create(this)), | 534 m_frameClient(RemoteFrameClientImpl::create(this)), |
| 522 m_client(client), | 535 m_client(client), |
| 523 m_selfKeepAlive(this) {} | 536 m_selfKeepAlive(this) {} |
| 524 | 537 |
| 525 } // namespace blink | 538 } // namespace blink |
| OLD | NEW |