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

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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 FeaturePolicy* parentFeaturePolicy = nullptr;
439 if (parent()) {
440 Frame* parentFrame = frame()->client()->parent();
441 parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy();
442 }
443 frame()->securityContext()->setFeaturePolicyFromHeader(headerValue,
444 parentFeaturePolicy);
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.h ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698