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

Unified Diff: content/renderer/render_frame_proxy.cc

Issue 2654873004: Move content-side Feature Policy code into content/{common,child}/feature_policy (Closed)
Patch Set: Fix missed nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | 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 ed11ec780ec49a325d733bc37cdf8ae7c8c6eb5c..b4a13b52ec73206319fb3b5be936def89569843d 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,23 +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::WebParsedFeaturePolicyHeader ToWebParsedFeaturePolicyHeader(
- const ParsedFeaturePolicyHeader& parsed_header) {
- std::vector<blink::WebParsedFeaturePolicyDeclaration> result;
- for (const ParsedFeaturePolicyDeclaration& declaration : parsed_header) {
- blink::WebParsedFeaturePolicyDeclaration web_declaration;
- web_declaration.featureName =
- blink::WebString::fromUTF8(declaration.feature_name);
- web_declaration.matchesAllOrigins = declaration.matches_all_origins;
- std::vector<blink::WebSecurityOrigin> web_origins;
- for (const url::Origin& origin : declaration.origins)
- web_origins.push_back(origin);
- web_declaration.origins = web_origins;
- result.push_back(web_declaration);
- }
- return result;
-}
-
} // namespace
// static
@@ -241,7 +225,7 @@ void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin(
state.has_potentially_trustworthy_unique_origin);
web_frame_->setReplicatedFeaturePolicyHeader(
- ToWebParsedFeaturePolicyHeader(state.feature_policy_header));
+ FeaturePolicyHeaderToWeb(state.feature_policy_header));
if (state.has_received_user_gesture)
web_frame_->setHasReceivedUserGesture();
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698