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

Side by Side Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 2483703002: Replicate feature policy headers to remote frames (Closed)
Patch Set: Addressing review comments Created 4 years, 1 month 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 // 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 frame()->securityContext()->enforceSandboxFlags( 431 frame()->securityContext()->enforceSandboxFlags(
432 static_cast<SandboxFlags>(flags)); 432 static_cast<SandboxFlags>(flags));
433 } 433 }
434 434
435 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, 435 void WebRemoteFrameImpl::setReplicatedName(const WebString& name,
436 const WebString& uniqueName) const { 436 const WebString& uniqueName) const {
437 DCHECK(frame()); 437 DCHECK(frame());
438 frame()->tree().setPrecalculatedName(name, uniqueName); 438 frame()->tree().setPrecalculatedName(name, uniqueName);
439 } 439 }
440 440
441 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader(
442 const WebString& headerValue) const {
443 if (RuntimeEnabledFeatures::featurePolicyEnabled()) {
444 SecurityContext* parentSecurityContext = nullptr;
445 if (parent()) {
446 Frame* parentFrame = frame()->client()->parent();
447 parentSecurityContext = parentFrame->securityContext();
448 }
449 frame()->securityContext()->setFeaturePolicyFromHeader(
450 headerValue, parentSecurityContext);
451 }
452 }
453
441 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( 454 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader(
442 const WebString& headerValue, 455 const WebString& headerValue,
443 WebContentSecurityPolicyType type, 456 WebContentSecurityPolicyType type,
444 WebContentSecurityPolicySource source) const { 457 WebContentSecurityPolicySource source) const {
445 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( 458 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue(
446 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), 459 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type),
447 static_cast<ContentSecurityPolicyHeaderSource>(source)); 460 static_cast<ContentSecurityPolicyHeaderSource>(source));
448 } 461 }
449 462
450 void WebRemoteFrameImpl::resetReplicatedContentSecurityPolicy() const { 463 void WebRemoteFrameImpl::resetReplicatedContentSecurityPolicy() const {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 535 }
523 536
524 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 537 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
525 WebRemoteFrameClient* client) 538 WebRemoteFrameClient* client)
526 : WebRemoteFrame(scope), 539 : WebRemoteFrame(scope),
527 m_frameClient(RemoteFrameClientImpl::create(this)), 540 m_frameClient(RemoteFrameClientImpl::create(this)),
528 m_client(client), 541 m_client(client),
529 m_selfKeepAlive(this) {} 542 m_selfKeepAlive(this) {}
530 543
531 } // namespace blink 544 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698