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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Temporary re-add the parser + transmit parsed CSP over IPC. 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
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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "content/browser/renderer_host/render_view_host_impl.h" 52 #include "content/browser/renderer_host/render_view_host_impl.h"
53 #include "content/browser/renderer_host/render_widget_host_delegate.h" 53 #include "content/browser/renderer_host/render_widget_host_delegate.h"
54 #include "content/browser/renderer_host/render_widget_host_impl.h" 54 #include "content/browser/renderer_host/render_widget_host_impl.h"
55 #include "content/browser/renderer_host/render_widget_host_view_base.h" 55 #include "content/browser/renderer_host/render_widget_host_view_base.h"
56 #include "content/browser/shared_worker/shared_worker_service_impl.h" 56 #include "content/browser/shared_worker/shared_worker_service_impl.h"
57 #include "content/browser/websockets/websocket_manager.h" 57 #include "content/browser/websockets/websocket_manager.h"
58 #include "content/browser/webui/web_ui_controller_factory_registry.h" 58 #include "content/browser/webui/web_ui_controller_factory_registry.h"
59 #include "content/common/accessibility_messages.h" 59 #include "content/common/accessibility_messages.h"
60 #include "content/common/associated_interface_provider_impl.h" 60 #include "content/common/associated_interface_provider_impl.h"
61 #include "content/common/associated_interfaces.mojom.h" 61 #include "content/common/associated_interfaces.mojom.h"
62 #include "content/common/content_security_policy/csp_policy.h"
62 #include "content/common/frame_messages.h" 63 #include "content/common/frame_messages.h"
63 #include "content/common/frame_owner_properties.h" 64 #include "content/common/frame_owner_properties.h"
64 #include "content/common/input_messages.h" 65 #include "content/common/input_messages.h"
65 #include "content/common/inter_process_time_ticks_converter.h" 66 #include "content/common/inter_process_time_ticks_converter.h"
66 #include "content/common/navigation_params.h" 67 #include "content/common/navigation_params.h"
67 #include "content/common/render_message_filter.mojom.h" 68 #include "content/common/render_message_filter.mojom.h"
68 #include "content/common/renderer.mojom.h" 69 #include "content/common/renderer.mojom.h"
69 #include "content/common/site_isolation_policy.h" 70 #include "content/common/site_isolation_policy.h"
70 #include "content/common/swapped_out_messages.h" 71 #include "content/common/swapped_out_messages.h"
71 #include "content/public/browser/ax_event_notification_details.h" 72 #include "content/public/browser/ax_event_notification_details.h"
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame(); 1769 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame();
1769 delegate_->DidChangeName(this, name); 1770 delegate_->DidChangeName(this, name);
1770 } 1771 }
1771 1772
1772 void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader( 1773 void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader(
1773 const ParsedFeaturePolicy& parsed_header) { 1774 const ParsedFeaturePolicy& parsed_header) {
1774 frame_tree_node()->SetFeaturePolicyHeader(parsed_header); 1775 frame_tree_node()->SetFeaturePolicyHeader(parsed_header);
1775 } 1776 }
1776 1777
1777 void RenderFrameHostImpl::OnDidAddContentSecurityPolicy( 1778 void RenderFrameHostImpl::OnDidAddContentSecurityPolicy(
1778 const ContentSecurityPolicyHeader& header) { 1779 const ContentSecurityPolicyHeader& header,
1779 frame_tree_node()->AddContentSecurityPolicy(header); 1780 const CSPPolicy& policy) {
1781 frame_tree_node()->AddContentSecurityPolicy(header, policy);
1780 } 1782 }
1781 1783
1782 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy( 1784 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy(
1783 blink::WebInsecureRequestPolicy policy) { 1785 blink::WebInsecureRequestPolicy policy) {
1784 frame_tree_node()->SetInsecureRequestPolicy(policy); 1786 frame_tree_node()->SetInsecureRequestPolicy(policy);
1785 } 1787 }
1786 1788
1787 void RenderFrameHostImpl::OnUpdateToUniqueOrigin( 1789 void RenderFrameHostImpl::OnUpdateToUniqueOrigin(
1788 bool is_potentially_trustworthy_unique_origin) { 1790 bool is_potentially_trustworthy_unique_origin) {
1789 url::Origin origin; 1791 url::Origin origin;
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
3395 // There is no pending NavigationEntry in these cases, so pass 0 as the 3397 // There is no pending NavigationEntry in these cases, so pass 0 as the
3396 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3398 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3397 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3399 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3398 return NavigationHandleImpl::Create( 3400 return NavigationHandleImpl::Create(
3399 params.url, frame_tree_node_, is_renderer_initiated, 3401 params.url, frame_tree_node_, is_renderer_initiated,
3400 params.was_within_same_page, base::TimeTicks::Now(), 3402 params.was_within_same_page, base::TimeTicks::Now(),
3401 entry_id_for_data_nav, false); // started_from_context_menu 3403 entry_id_for_data_nav, false); // started_from_context_menu
3402 } 3404 }
3403 3405
3404 } // namespace content 3406 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698