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

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

Issue 2651883008: Make content::FeaturePolicy implement WebFeaturePolicy, and use it in blink code (Closed)
Patch Set: Duplicate FP object rather than modifying in-place Created 3 years, 9 months 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 "bindings/core/v8/RemoteWindowProxy.h" 7 #include "bindings/core/v8/RemoteWindowProxy.h"
8 #include "core/dom/Fullscreen.h" 8 #include "core/dom/Fullscreen.h"
9 #include "core/dom/RemoteSecurityContext.h" 9 #include "core/dom/RemoteSecurityContext.h"
10 #include "core/dom/SecurityContext.h" 10 #include "core/dom/SecurityContext.h"
11 #include "core/frame/FrameView.h" 11 #include "core/frame/FrameView.h"
12 #include "core/frame/Settings.h" 12 #include "core/frame/Settings.h"
13 #include "core/frame/csp/ContentSecurityPolicy.h" 13 #include "core/frame/csp/ContentSecurityPolicy.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/layout/LayoutObject.h" 15 #include "core/layout/LayoutObject.h"
16 #include "core/page/Page.h" 16 #include "core/page/Page.h"
17 #include "platform/heap/Handle.h" 17 #include "platform/heap/Handle.h"
18 #include "public/platform/WebFeaturePolicy.h"
18 #include "public/platform/WebFloatRect.h" 19 #include "public/platform/WebFloatRect.h"
19 #include "public/platform/WebRect.h" 20 #include "public/platform/WebRect.h"
20 #include "public/web/WebDocument.h" 21 #include "public/web/WebDocument.h"
21 #include "public/web/WebFrameOwnerProperties.h" 22 #include "public/web/WebFrameOwnerProperties.h"
22 #include "public/web/WebPerformance.h" 23 #include "public/web/WebPerformance.h"
23 #include "public/web/WebRange.h" 24 #include "public/web/WebRange.h"
24 #include "public/web/WebTreeScopeType.h" 25 #include "public/web/WebTreeScopeType.h"
25 #include "v8/include/v8.h" 26 #include "v8/include/v8.h"
26 #include "web/RemoteFrameOwner.h" 27 #include "web/RemoteFrameOwner.h"
27 #include "web/WebLocalFrameImpl.h" 28 #include "web/WebLocalFrameImpl.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 425
425 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, 426 void WebRemoteFrameImpl::setReplicatedName(const WebString& name,
426 const WebString& uniqueName) const { 427 const WebString& uniqueName) const {
427 DCHECK(frame()); 428 DCHECK(frame());
428 frame()->tree().setPrecalculatedName(name, uniqueName); 429 frame()->tree().setPrecalculatedName(name, uniqueName);
429 } 430 }
430 431
431 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader( 432 void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader(
432 const WebParsedFeaturePolicyHeader& parsedHeader) const { 433 const WebParsedFeaturePolicyHeader& parsedHeader) const {
433 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { 434 if (RuntimeEnabledFeatures::featurePolicyEnabled()) {
434 FeaturePolicy* parentFeaturePolicy = nullptr; 435 WebFeaturePolicy* parentFeaturePolicy = nullptr;
435 if (parent()) { 436 if (parent()) {
436 Frame* parentFrame = frame()->client()->parent(); 437 Frame* parentFrame = frame()->client()->parent();
437 parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy(); 438 parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy();
438 } 439 }
439 frame()->securityContext()->setFeaturePolicyFromHeader(parsedHeader, 440 frame()->securityContext()->initializeFeaturePolicy(parsedHeader,
haraken 2017/03/04 07:36:01 Also we can make initializeFeaturePolicy a method
440 parentFeaturePolicy); 441 parentFeaturePolicy);
441 } 442 }
442 } 443 }
443 444
444 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader( 445 void WebRemoteFrameImpl::addReplicatedContentSecurityPolicyHeader(
445 const WebString& headerValue, 446 const WebString& headerValue,
446 WebContentSecurityPolicyType type, 447 WebContentSecurityPolicyType type,
447 WebContentSecurityPolicySource source) const { 448 WebContentSecurityPolicySource source) const {
448 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue( 449 frame()->securityContext()->contentSecurityPolicy()->addPolicyFromHeaderValue(
449 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type), 450 headerValue, static_cast<ContentSecurityPolicyHeaderType>(type),
450 static_cast<ContentSecurityPolicyHeaderSource>(source)); 451 static_cast<ContentSecurityPolicyHeaderSource>(source));
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 } 531 }
531 532
532 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
533 WebRemoteFrameClient* client) 534 WebRemoteFrameClient* client)
534 : WebRemoteFrame(scope), 535 : WebRemoteFrame(scope),
535 m_frameClient(RemoteFrameClientImpl::create(this)), 536 m_frameClient(RemoteFrameClientImpl::create(this)),
536 m_client(client), 537 m_client(client),
537 m_selfKeepAlive(this) {} 538 m_selfKeepAlive(this) {}
538 539
539 } // namespace blink 540 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698