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

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: 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 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 #else 871 #else
872 return true; 872 return true;
873 #endif 873 #endif
874 } 874 }
875 #endif // defined(ENABLE_MOJO_CDM) 875 #endif // defined(ENABLE_MOJO_CDM)
876 876
877 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) { 877 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) {
878 return (time_ticks - base::TimeTicks()).InSecondsF(); 878 return (time_ticks - base::TimeTicks()).InSecondsF();
879 } 879 }
880 880
881 std::vector<FeaturePolicyParsedWhitelist> ToFeaturePolicyParsedWhitelist(
882 const blink::WebParsedFeaturePolicy& 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::WebSecurityOrigin& web_origin : web_whitelist.origins)
890 whitelist.origins.push_back(web_origin);
891 result.push_back(whitelist);
892 }
893 return result;
894 }
895
881 } // namespace 896 } // namespace
882 897
883 struct RenderFrameImpl::PendingFileChooser { 898 struct RenderFrameImpl::PendingFileChooser {
884 PendingFileChooser(const FileChooserParams& p, 899 PendingFileChooser(const FileChooserParams& p,
885 blink::WebFileChooserCompletion* c) 900 blink::WebFileChooserCompletion* c)
886 : params(p), completion(c) {} 901 : params(p), completion(c) {}
887 FileChooserParams params; 902 FileChooserParams params;
888 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. 903 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback.
889 }; 904 };
890 905
(...skipping 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3125 routing_id_, is_potentially_trustworthy_unique_origin)); 3140 routing_id_, is_potentially_trustworthy_unique_origin));
3126 } 3141 }
3127 3142
3128 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, 3143 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
3129 blink::WebSandboxFlags flags) { 3144 blink::WebSandboxFlags flags) {
3130 Send(new FrameHostMsg_DidChangeSandboxFlags( 3145 Send(new FrameHostMsg_DidChangeSandboxFlags(
3131 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); 3146 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags));
3132 } 3147 }
3133 3148
3134 void RenderFrameImpl::didSetFeaturePolicyHeader( 3149 void RenderFrameImpl::didSetFeaturePolicyHeader(
3135 const blink::WebString& header_value) { 3150 const blink::WebParsedFeaturePolicy& parsed_header) {
3136 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(routing_id_, 3151 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(
3137 header_value.utf8())); 3152 routing_id_, ToFeaturePolicyParsedWhitelist(parsed_header)));
3138 } 3153 }
3139 3154
3140 void RenderFrameImpl::didAddContentSecurityPolicy( 3155 void RenderFrameImpl::didAddContentSecurityPolicy(
3141 const blink::WebString& header_value, 3156 const blink::WebString& header_value,
3142 blink::WebContentSecurityPolicyType type, 3157 blink::WebContentSecurityPolicyType type,
3143 blink::WebContentSecurityPolicySource source) { 3158 blink::WebContentSecurityPolicySource source) {
3144 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 3159 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
3145 return; 3160 return;
3146 3161
3147 ContentSecurityPolicyHeader header; 3162 ContentSecurityPolicyHeader header;
(...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after
6667 // event target. Potentially a Pepper plugin will receive the event. 6682 // event target. Potentially a Pepper plugin will receive the event.
6668 // In order to tell whether a plugin gets the last mouse event and which it 6683 // In order to tell whether a plugin gets the last mouse event and which it
6669 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6684 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6670 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6685 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6671 // |pepper_last_mouse_event_target_|. 6686 // |pepper_last_mouse_event_target_|.
6672 pepper_last_mouse_event_target_ = nullptr; 6687 pepper_last_mouse_event_target_ = nullptr;
6673 #endif 6688 #endif
6674 } 6689 }
6675 6690
6676 } // namespace content 6691 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698