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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2654873004: Move content-side Feature Policy code into content/{common,child}/feature_policy (Closed)
Patch Set: Fix missed nit Created 3 years, 11 months 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
« no previous file with comments | « content/common/frame_replication_state.cc ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 #else 868 #else
868 return true; 869 return true;
869 #endif 870 #endif
870 } 871 }
871 #endif // defined(ENABLE_MOJO_CDM) 872 #endif // defined(ENABLE_MOJO_CDM)
872 873
873 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) { 874 double ConvertToBlinkTime(const base::TimeTicks& time_ticks) {
874 return (time_ticks - base::TimeTicks()).InSecondsF(); 875 return (time_ticks - base::TimeTicks()).InSecondsF();
875 } 876 }
876 877
877 ParsedFeaturePolicyHeader ToParsedFeaturePolicyHeader(
878 const blink::WebParsedFeaturePolicyHeader& parsed_header) {
879 ParsedFeaturePolicyHeader result;
880 for (const blink::WebParsedFeaturePolicyDeclaration& web_declaration :
881 parsed_header) {
882 ParsedFeaturePolicyDeclaration declaration;
883 declaration.feature_name = web_declaration.featureName.utf8();
884 declaration.matches_all_origins = web_declaration.matchesAllOrigins;
885 for (const blink::WebSecurityOrigin& web_origin : web_declaration.origins)
886 declaration.origins.push_back(web_origin);
887 result.push_back(declaration);
888 }
889 return result;
890 }
891
892 } // namespace 878 } // namespace
893 879
894 struct RenderFrameImpl::PendingFileChooser { 880 struct RenderFrameImpl::PendingFileChooser {
895 PendingFileChooser(const FileChooserParams& p, 881 PendingFileChooser(const FileChooserParams& p,
896 blink::WebFileChooserCompletion* c) 882 blink::WebFileChooserCompletion* c)
897 : params(p), completion(c) {} 883 : params(p), completion(c) {}
898 FileChooserParams params; 884 FileChooserParams params;
899 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. 885 blink::WebFileChooserCompletion* completion; // MAY BE NULL to skip callback.
900 }; 886 };
901 887
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
3191 3177
3192 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, 3178 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
3193 blink::WebSandboxFlags flags) { 3179 blink::WebSandboxFlags flags) {
3194 Send(new FrameHostMsg_DidChangeSandboxFlags( 3180 Send(new FrameHostMsg_DidChangeSandboxFlags(
3195 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); 3181 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags));
3196 } 3182 }
3197 3183
3198 void RenderFrameImpl::didSetFeaturePolicyHeader( 3184 void RenderFrameImpl::didSetFeaturePolicyHeader(
3199 const blink::WebParsedFeaturePolicyHeader& parsed_header) { 3185 const blink::WebParsedFeaturePolicyHeader& parsed_header) {
3200 Send(new FrameHostMsg_DidSetFeaturePolicyHeader( 3186 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(
3201 routing_id_, ToParsedFeaturePolicyHeader(parsed_header))); 3187 routing_id_, FeaturePolicyHeaderFromWeb(parsed_header)));
3202 } 3188 }
3203 3189
3204 void RenderFrameImpl::didAddContentSecurityPolicy( 3190 void RenderFrameImpl::didAddContentSecurityPolicy(
3205 const blink::WebString& header_value, 3191 const blink::WebString& header_value,
3206 blink::WebContentSecurityPolicyType type, 3192 blink::WebContentSecurityPolicyType type,
3207 blink::WebContentSecurityPolicySource source) { 3193 blink::WebContentSecurityPolicySource source) {
3208 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 3194 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
3209 return; 3195 return;
3210 3196
3211 ContentSecurityPolicyHeader header; 3197 ContentSecurityPolicyHeader header;
(...skipping 3664 matching lines...) Expand 10 before | Expand all | Expand 10 after
6876 // event target. Potentially a Pepper plugin will receive the event. 6862 // event target. Potentially a Pepper plugin will receive the event.
6877 // In order to tell whether a plugin gets the last mouse event and which it 6863 // In order to tell whether a plugin gets the last mouse event and which it
6878 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6864 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6879 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6865 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6880 // |pepper_last_mouse_event_target_|. 6866 // |pepper_last_mouse_event_target_|.
6881 pepper_last_mouse_event_target_ = nullptr; 6867 pepper_last_mouse_event_target_ = nullptr;
6882 #endif 6868 #endif
6883 } 6869 }
6884 6870
6885 } // namespace content 6871 } // namespace content
OLDNEW
« no previous file with comments | « content/common/frame_replication_state.cc ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698