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

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

Issue 2764993002: CSP: group policies in didAddContentSecurityPolicy. (Closed)
Patch Set: Group the IPC instead of splitting them. (browser -> renderer) Created 3 years, 9 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 OnRunJavaScriptDialog) 719 OnRunJavaScriptDialog)
720 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, 720 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm,
721 OnRunBeforeUnloadConfirm) 721 OnRunBeforeUnloadConfirm)
722 IPC_MESSAGE_HANDLER(FrameHostMsg_RunFileChooser, OnRunFileChooser) 722 IPC_MESSAGE_HANDLER(FrameHostMsg_RunFileChooser, OnRunFileChooser)
723 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, 723 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument,
724 OnDidAccessInitialDocument) 724 OnDidAccessInitialDocument)
725 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener) 725 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener)
726 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName) 726 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName)
727 IPC_MESSAGE_HANDLER(FrameHostMsg_DidSetFeaturePolicyHeader, 727 IPC_MESSAGE_HANDLER(FrameHostMsg_DidSetFeaturePolicyHeader,
728 OnDidSetFeaturePolicyHeader) 728 OnDidSetFeaturePolicyHeader)
729 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicy, 729 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicies,
730 OnDidAddContentSecurityPolicy) 730 OnDidAddContentSecurityPolicies)
731 IPC_MESSAGE_HANDLER(FrameHostMsg_EnforceInsecureRequestPolicy, 731 IPC_MESSAGE_HANDLER(FrameHostMsg_EnforceInsecureRequestPolicy,
732 OnEnforceInsecureRequestPolicy) 732 OnEnforceInsecureRequestPolicy)
733 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin, 733 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin,
734 OnUpdateToUniqueOrigin) 734 OnUpdateToUniqueOrigin)
735 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, 735 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags,
736 OnDidChangeSandboxFlags) 736 OnDidChangeSandboxFlags)
737 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties, 737 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties,
738 OnDidChangeFrameOwnerProperties) 738 OnDidChangeFrameOwnerProperties)
739 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) 739 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle)
740 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) 740 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding)
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 delegate_->DidChangeName(this, name); 1858 delegate_->DidChangeName(this, name);
1859 } 1859 }
1860 1860
1861 void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader( 1861 void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader(
1862 const ParsedFeaturePolicyHeader& parsed_header) { 1862 const ParsedFeaturePolicyHeader& parsed_header) {
1863 frame_tree_node()->SetFeaturePolicyHeader(parsed_header); 1863 frame_tree_node()->SetFeaturePolicyHeader(parsed_header);
1864 ResetFeaturePolicy(); 1864 ResetFeaturePolicy();
1865 feature_policy_->SetHeaderPolicy(parsed_header); 1865 feature_policy_->SetHeaderPolicy(parsed_header);
1866 } 1866 }
1867 1867
1868 void RenderFrameHostImpl::OnDidAddContentSecurityPolicy( 1868 void RenderFrameHostImpl::OnDidAddContentSecurityPolicies(
1869 const ContentSecurityPolicyHeader& header,
1870 const std::vector<ContentSecurityPolicy>& policies) { 1869 const std::vector<ContentSecurityPolicy>& policies) {
1871 frame_tree_node()->AddContentSecurityPolicy(header); 1870 for (const ContentSecurityPolicy& policy : policies) {
1872 for (const ContentSecurityPolicy& policy : policies) 1871 frame_tree_node()->AddContentSecurityPolicy(policy.header);
1873 AddContentSecurityPolicy(policy); 1872 AddContentSecurityPolicy(policy);
1873 }
1874 } 1874 }
1875 1875
1876 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy( 1876 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy(
1877 blink::WebInsecureRequestPolicy policy) { 1877 blink::WebInsecureRequestPolicy policy) {
1878 frame_tree_node()->SetInsecureRequestPolicy(policy); 1878 frame_tree_node()->SetInsecureRequestPolicy(policy);
1879 } 1879 }
1880 1880
1881 void RenderFrameHostImpl::OnUpdateToUniqueOrigin( 1881 void RenderFrameHostImpl::OnUpdateToUniqueOrigin(
1882 bool is_potentially_trustworthy_unique_origin) { 1882 bool is_potentially_trustworthy_unique_origin) {
1883 url::Origin origin; 1883 url::Origin origin;
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after
3560 service_manager::mojom::InterfaceProviderPtr provider; 3560 service_manager::mojom::InterfaceProviderPtr provider;
3561 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); 3561 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this);
3562 java_interfaces_.reset(new service_manager::InterfaceProvider); 3562 java_interfaces_.reset(new service_manager::InterfaceProvider);
3563 java_interfaces_->Bind(std::move(provider)); 3563 java_interfaces_->Bind(std::move(provider));
3564 } 3564 }
3565 return java_interfaces_.get(); 3565 return java_interfaces_.get();
3566 } 3566 }
3567 #endif 3567 #endif
3568 3568
3569 } // namespace content 3569 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698