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