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

Side by Side 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: Fp2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 #else 870 #else
871 return true; 871 return true;
872 #endif 872 #endif
873 } 873 }
874 #endif // defined(ENABLE_MOJO_CDM) 874 #endif // defined(ENABLE_MOJO_CDM)
875 875
876 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) { 876 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) {
877 return (time_ticks - base::TimeTicks()).InSecondsF(); 877 return (time_ticks - base::TimeTicks()).InSecondsF();
878 } 878 }
879 879
880 std::vector<FeaturePolicyParsedWhitelist> ToFeaturePolicyParsedWhitelist(
881 const blink::WebVector<blink::WebFeaturePolicy::ParsedWhitelist>&
882 web_parsed_whitelists) {
883 std::vector<FeaturePolicyParsedWhitelist> result;
884 for (const blink::WebFeaturePolicy::ParsedWhitelist& web_whitelist :
885 web_parsed_whitelists) {
886 FeaturePolicyParsedWhitelist whitelist;
887 whitelist.feature_name = web_whitelist.featureName.utf8();
888 whitelist.matches_all_origins = web_whitelist.matchesAllOrigins;
889 for (const blink::WebString& web_origin : web_whitelist.origins)
890 whitelist.origins.push_back(web_origin.utf8());
891 result.push_back(whitelist);
892 }
893 return result;
894 }
895
880 } // namespace 896 } // namespace
881 897
882 struct RenderFrameImpl::PendingFileChooser { 898 struct RenderFrameImpl::PendingFileChooser {
883 PendingFileChooser(const FileChooserParams& p, 899 PendingFileChooser(const FileChooserParams& p,
884 blink::WebFileChooserCompletion* c) 900 blink::WebFileChooserCompletion* c)
885 : params(p), completion(c) {} 901 : params(p), completion(c) {}
886 FileChooserParams params; 902 FileChooserParams params;
887 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. 903 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback.
888 }; 904 };
889 905
(...skipping 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after
3103 routing_id_, is_potentially_trustworthy_unique_origin)); 3119 routing_id_, is_potentially_trustworthy_unique_origin));
3104 } 3120 }
3105 3121
3106 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, 3122 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
3107 blink::WebSandboxFlags flags) { 3123 blink::WebSandboxFlags flags) {
3108 Send(new FrameHostMsg_DidChangeSandboxFlags( 3124 Send(new FrameHostMsg_DidChangeSandboxFlags(
3109 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); 3125 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags));
3110 } 3126 }
3111 3127
3112 void RenderFrameImpl::didSetFeaturePolicyHeader( 3128 void RenderFrameImpl::didSetFeaturePolicyHeader(
3113 const blink::WebString& header_value) { 3129 const blink::WebVector<blink::WebFeaturePolicy::ParsedWhitelist>&
3114 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(routing_id_, 3130 parsed_header) {
3115 header_value.utf8())); 3131 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(
3132 routing_id_, ToFeaturePolicyParsedWhitelist(parsed_header)));
3116 } 3133 }
3117 3134
3118 void RenderFrameImpl::didAddContentSecurityPolicy( 3135 void RenderFrameImpl::didAddContentSecurityPolicy(
3119 const blink::WebString& header_value, 3136 const blink::WebString& header_value,
3120 blink::WebContentSecurityPolicyType type, 3137 blink::WebContentSecurityPolicyType type,
3121 blink::WebContentSecurityPolicySource source) { 3138 blink::WebContentSecurityPolicySource source) {
3122 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 3139 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
3123 return; 3140 return;
3124 3141
3125 ContentSecurityPolicyHeader header; 3142 ContentSecurityPolicyHeader header;
(...skipping 3517 matching lines...) Expand 10 before | Expand all | Expand 10 after
6643 // event target. Potentially a Pepper plugin will receive the event. 6660 // event target. Potentially a Pepper plugin will receive the event.
6644 // In order to tell whether a plugin gets the last mouse event and which it 6661 // In order to tell whether a plugin gets the last mouse event and which it
6645 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6662 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6646 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6663 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6647 // |pepper_last_mouse_event_target_|. 6664 // |pepper_last_mouse_event_target_|.
6648 pepper_last_mouse_event_target_ = nullptr; 6665 pepper_last_mouse_event_target_ = nullptr;
6649 #endif 6666 #endif
6650 } 6667 }
6651 6668
6652 } // namespace content 6669 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698