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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 2653623004: [WIP NOT FOR COMMIT] Feature policy: Add basic algorithm for supporting frame policies, start plumb… (Closed)
Patch Set: Created 3 years, 11 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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 855 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
856 return static_cast<int>( 856 return static_cast<int>(
857 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 857 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
858 } 858 }
859 859
860 blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy( 860 blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy(
861 const blink::WebFeaturePolicy* parentPolicy, 861 const blink::WebFeaturePolicy* parentPolicy,
862 const blink::WebParsedFeaturePolicyHeader& policyHeader, 862 const blink::WebParsedFeaturePolicyHeader& policyHeader,
863 const blink::WebSecurityOrigin& origin) { 863 const blink::WebSecurityOrigin& origin) {
864 std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy( 864 std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy(
865 static_cast<const FeaturePolicy*>(parentPolicy), url::Origin(origin)); 865 static_cast<const FeaturePolicy*>(parentPolicy), nullptr,
866 url::Origin(origin));
866 policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader)); 867 policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader));
867 return policy.release(); 868 return policy.release();
868 } 869 }
869 870
870 bool BlinkPlatformImpl::isFeatureEnabledByPolicy( 871 bool BlinkPlatformImpl::isFeatureEnabledByPolicy(
871 const blink::WebFeaturePolicy* policy, 872 const blink::WebFeaturePolicy* policy,
872 blink::WebFeaturePolicyFeature feature, 873 blink::WebFeaturePolicyFeature feature,
873 const blink::WebSecurityOrigin& origin) { 874 const blink::WebSecurityOrigin& origin) {
874 // if (!policy) 875 // if (!policy)
875 // return FeaturePolicy::IsFeatureAllowedByDefault(""); 876 // return FeaturePolicy::IsFeatureAllowedByDefault("");
876 return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( 877 return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin(
877 feature, url::Origin(origin)); 878 feature, url::Origin(origin));
878 } 879 }
879 880
880 } // namespace content 881 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | content/common/feature_policy/feature_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698