Chromium Code Reviews

Unified Diff: content/renderer/render_frame_proxy.cc

Issue 2636843003: Move most Feature Policy code into content/ (Closed)
Patch Set: Addressing review comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_proxy.cc
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc
index fe58b65b758864d090f39cd88d2da9fc6ec89e2e..445f3520a94a55018996054c26b8eb46d56455a3 100644
--- a/content/renderer/render_frame_proxy.cc
+++ b/content/renderer/render_frame_proxy.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "content/child/feature_policy/feature_policy_platform.h"
#include "content/child/web_url_request_util.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/content_security_policy_header.h"
@@ -49,22 +50,6 @@ static base::LazyInstance<RoutingIDProxyMap> g_routing_id_proxy_map =
typedef std::map<blink::WebFrame*, RenderFrameProxy*> FrameMap;
base::LazyInstance<FrameMap> g_frame_map = LAZY_INSTANCE_INITIALIZER;
-blink::WebParsedFeaturePolicy ToWebParsedFeaturePolicy(
- const ParsedFeaturePolicy& parsed_whitelists) {
- std::vector<blink::WebFeaturePolicy::ParsedWhitelist> result;
- for (const FeaturePolicyParsedWhitelist& whitelist : parsed_whitelists) {
- blink::WebFeaturePolicy::ParsedWhitelist web_whitelist;
- web_whitelist.featureName =
- blink::WebString::fromUTF8(whitelist.feature_name);
- web_whitelist.matchesAllOrigins = whitelist.matches_all_origins;
- std::vector<blink::WebSecurityOrigin> web_origins;
- for (const url::Origin& origin : whitelist.origins)
- web_origins.push_back(origin);
- result.push_back(web_whitelist);
- }
- return result;
-}
-
} // namespace
// static
@@ -242,7 +227,7 @@ void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin(
state.has_potentially_trustworthy_unique_origin);
web_frame_->setReplicatedFeaturePolicyHeader(
- ToWebParsedFeaturePolicy(state.feature_policy_header));
+ FeaturePolicyHeaderToWeb(state.feature_policy_header));
web_frame_->resetReplicatedContentSecurityPolicy();
for (const auto& header : state.accumulated_csp_headers)
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine