| 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 18 matching lines...) Expand all Loading... |
| 29 #include "base/stl_util.h" | 29 #include "base/stl_util.h" |
| 30 #include "base/strings/string16.h" | 30 #include "base/strings/string16.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/task_runner_util.h" | 32 #include "base/task_runner_util.h" |
| 33 #include "base/threading/thread_task_runner_handle.h" | 33 #include "base/threading/thread_task_runner_handle.h" |
| 34 #include "base/time/time.h" | 34 #include "base/time/time.h" |
| 35 #include "base/trace_event/trace_event.h" | 35 #include "base/trace_event/trace_event.h" |
| 36 #include "build/build_config.h" | 36 #include "build/build_config.h" |
| 37 #include "cc/base/switches.h" | 37 #include "cc/base/switches.h" |
| 38 #include "content/child/appcache/appcache_dispatcher.h" | 38 #include "content/child/appcache/appcache_dispatcher.h" |
| 39 #include "content/child/feature_policy/feature_policy_platform.h" |
| 39 #include "content/child/quota_dispatcher.h" | 40 #include "content/child/quota_dispatcher.h" |
| 40 #include "content/child/request_extra_data.h" | 41 #include "content/child/request_extra_data.h" |
| 41 #include "content/child/service_worker/service_worker_handle_reference.h" | 42 #include "content/child/service_worker/service_worker_handle_reference.h" |
| 42 #include "content/child/service_worker/service_worker_network_provider.h" | 43 #include "content/child/service_worker/service_worker_network_provider.h" |
| 43 #include "content/child/service_worker/service_worker_provider_context.h" | 44 #include "content/child/service_worker/service_worker_provider_context.h" |
| 44 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 45 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
| 45 #include "content/child/v8_value_converter_impl.h" | 46 #include "content/child/v8_value_converter_impl.h" |
| 46 #include "content/child/web_url_loader_impl.h" | 47 #include "content/child/web_url_loader_impl.h" |
| 47 #include "content/child/web_url_request_util.h" | 48 #include "content/child/web_url_request_util.h" |
| 48 #include "content/child/webmessageportchannel_impl.h" | 49 #include "content/child/webmessageportchannel_impl.h" |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 #else | 863 #else |
| 863 return true; | 864 return true; |
| 864 #endif | 865 #endif |
| 865 } | 866 } |
| 866 #endif // defined(ENABLE_MOJO_CDM) | 867 #endif // defined(ENABLE_MOJO_CDM) |
| 867 | 868 |
| 868 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) { | 869 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) { |
| 869 return (time_ticks - base::TimeTicks()).InSecondsF(); | 870 return (time_ticks - base::TimeTicks()).InSecondsF(); |
| 870 } | 871 } |
| 871 | 872 |
| 872 ParsedFeaturePolicy ToParsedFeaturePolicy( | |
| 873 const blink::WebParsedFeaturePolicy& web_parsed_whitelists) { | |
| 874 ParsedFeaturePolicy result; | |
| 875 for (const blink::WebFeaturePolicy::ParsedWhitelist& web_whitelist : | |
| 876 web_parsed_whitelists) { | |
| 877 FeaturePolicyParsedWhitelist whitelist; | |
| 878 whitelist.feature_name = web_whitelist.featureName.utf8(); | |
| 879 whitelist.matches_all_origins = web_whitelist.matchesAllOrigins; | |
| 880 for (const blink::WebSecurityOrigin& web_origin : web_whitelist.origins) | |
| 881 whitelist.origins.push_back(web_origin); | |
| 882 result.push_back(whitelist); | |
| 883 } | |
| 884 return result; | |
| 885 } | |
| 886 | |
| 887 } // namespace | 873 } // namespace |
| 888 | 874 |
| 889 struct RenderFrameImpl::PendingFileChooser { | 875 struct RenderFrameImpl::PendingFileChooser { |
| 890 PendingFileChooser(const FileChooserParams& p, | 876 PendingFileChooser(const FileChooserParams& p, |
| 891 blink::WebFileChooserCompletion* c) | 877 blink::WebFileChooserCompletion* c) |
| 892 : params(p), completion(c) {} | 878 : params(p), completion(c) {} |
| 893 FileChooserParams params; | 879 FileChooserParams params; |
| 894 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. | 880 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. |
| 895 }; | 881 }; |
| 896 | 882 |
| (...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 routing_id_, is_potentially_trustworthy_unique_origin)); | 3173 routing_id_, is_potentially_trustworthy_unique_origin)); |
| 3188 } | 3174 } |
| 3189 | 3175 |
| 3190 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, | 3176 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, |
| 3191 blink::WebSandboxFlags flags) { | 3177 blink::WebSandboxFlags flags) { |
| 3192 Send(new FrameHostMsg_DidChangeSandboxFlags( | 3178 Send(new FrameHostMsg_DidChangeSandboxFlags( |
| 3193 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); | 3179 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); |
| 3194 } | 3180 } |
| 3195 | 3181 |
| 3196 void RenderFrameImpl::didSetFeaturePolicyHeader( | 3182 void RenderFrameImpl::didSetFeaturePolicyHeader( |
| 3197 const blink::WebParsedFeaturePolicy& parsed_header) { | 3183 const blink::WebParsedFeaturePolicyHeader& parsed_header) { |
| 3198 Send(new FrameHostMsg_DidSetFeaturePolicyHeader( | 3184 Send(new FrameHostMsg_DidSetFeaturePolicyHeader( |
| 3199 routing_id_, ToParsedFeaturePolicy(parsed_header))); | 3185 routing_id_, FeaturePolicyHeaderFromWeb(parsed_header))); |
| 3200 } | 3186 } |
| 3201 | 3187 |
| 3202 void RenderFrameImpl::didAddContentSecurityPolicy( | 3188 void RenderFrameImpl::didAddContentSecurityPolicy( |
| 3203 const blink::WebString& header_value, | 3189 const blink::WebString& header_value, |
| 3204 blink::WebContentSecurityPolicyType type, | 3190 blink::WebContentSecurityPolicyType type, |
| 3205 blink::WebContentSecurityPolicySource source) { | 3191 blink::WebContentSecurityPolicySource source) { |
| 3206 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 3192 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 3207 return; | 3193 return; |
| 3208 | 3194 |
| 3209 ContentSecurityPolicyHeader header; | 3195 ContentSecurityPolicyHeader header; |
| (...skipping 3664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6874 // event target. Potentially a Pepper plugin will receive the event. | 6860 // event target. Potentially a Pepper plugin will receive the event. |
| 6875 // In order to tell whether a plugin gets the last mouse event and which it | 6861 // In order to tell whether a plugin gets the last mouse event and which it |
| 6876 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6862 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6877 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6863 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6878 // |pepper_last_mouse_event_target_|. | 6864 // |pepper_last_mouse_event_target_|. |
| 6879 pepper_last_mouse_event_target_ = nullptr; | 6865 pepper_last_mouse_event_target_ = nullptr; |
| 6880 #endif | 6866 #endif |
| 6881 } | 6867 } |
| 6882 | 6868 |
| 6883 } // namespace content | 6869 } // namespace content |
| OLD | NEW |