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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2520223002: Replicate a parsed feature policy representation so it doesn't need to be parsed in the browser pro… (Closed)
Patch Set: Replicate a parsed feature policy representation so it doesn't need to be parsed in the browser pro… Created 4 years 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.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1b47b0773d3bdef13283ef94116fc4d3ad244bd6..d8b18e07a5e182d9cdc959d6265d34713f8d86c1 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -881,6 +881,21 @@ double ConvertToBlinkTime(const base::TimeTicks& time_ticks) {
return (time_ticks - base::TimeTicks()).InSecondsF();
}
+ParsedFeaturePolicy ToParsedFeaturePolicy(
+ const blink::WebParsedFeaturePolicy& web_parsed_whitelists) {
+ ParsedFeaturePolicy result;
+ for (const blink::WebFeaturePolicy::ParsedWhitelist& web_whitelist :
+ web_parsed_whitelists) {
+ FeaturePolicyParsedWhitelist whitelist;
+ whitelist.feature_name = web_whitelist.featureName.utf8();
+ whitelist.matches_all_origins = web_whitelist.matchesAllOrigins;
+ for (const blink::WebSecurityOrigin& web_origin : web_whitelist.origins)
+ whitelist.origins.push_back(web_origin);
+ result.push_back(whitelist);
+ }
+ return result;
+}
+
} // namespace
struct RenderFrameImpl::PendingFileChooser {
@@ -3135,9 +3150,9 @@ void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
}
void RenderFrameImpl::didSetFeaturePolicyHeader(
- const blink::WebString& header_value) {
- Send(new FrameHostMsg_DidSetFeaturePolicyHeader(routing_id_,
- header_value.utf8()));
+ const blink::WebParsedFeaturePolicy& parsed_header) {
+ Send(new FrameHostMsg_DidSetFeaturePolicyHeader(
+ routing_id_, ToParsedFeaturePolicy(parsed_header)));
}
void RenderFrameImpl::didAddContentSecurityPolicy(
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698