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

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

Issue 2483703002: Replicate feature policy headers to remote frames (Closed)
Patch Set: Remove layout test; better coverage with unit tests Created 4 years, 1 month 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 OnVisualStateResponse) 671 OnVisualStateResponse)
672 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, 672 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage,
673 OnRunJavaScriptMessage) 673 OnRunJavaScriptMessage)
674 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, 674 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm,
675 OnRunBeforeUnloadConfirm) 675 OnRunBeforeUnloadConfirm)
676 IPC_MESSAGE_HANDLER(FrameHostMsg_RunFileChooser, OnRunFileChooser) 676 IPC_MESSAGE_HANDLER(FrameHostMsg_RunFileChooser, OnRunFileChooser)
677 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, 677 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument,
678 OnDidAccessInitialDocument) 678 OnDidAccessInitialDocument)
679 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener) 679 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener)
680 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName) 680 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName)
681 IPC_MESSAGE_HANDLER(FrameHostMsg_DidSetFeaturePolicyHeader,
682 OnDidSetFeaturePolicyHeader)
681 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicy, 683 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicy,
682 OnDidAddContentSecurityPolicy) 684 OnDidAddContentSecurityPolicy)
683 IPC_MESSAGE_HANDLER(FrameHostMsg_EnforceInsecureRequestPolicy, 685 IPC_MESSAGE_HANDLER(FrameHostMsg_EnforceInsecureRequestPolicy,
684 OnEnforceInsecureRequestPolicy) 686 OnEnforceInsecureRequestPolicy)
685 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin, 687 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin,
686 OnUpdateToUniqueOrigin) 688 OnUpdateToUniqueOrigin)
687 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, 689 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags,
688 OnDidChangeSandboxFlags) 690 OnDidChangeSandboxFlags)
689 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties, 691 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties,
690 OnDidChangeFrameOwnerProperties) 692 OnDidChangeFrameOwnerProperties)
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 DCHECK(!unique_name.empty()); 1698 DCHECK(!unique_name.empty());
1697 } 1699 }
1698 1700
1699 std::string old_name = frame_tree_node()->frame_name(); 1701 std::string old_name = frame_tree_node()->frame_name();
1700 frame_tree_node()->SetFrameName(name, unique_name); 1702 frame_tree_node()->SetFrameName(name, unique_name);
1701 if (old_name.empty() && !name.empty()) 1703 if (old_name.empty() && !name.empty())
1702 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame(); 1704 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame();
1703 delegate_->DidChangeName(this, name); 1705 delegate_->DidChangeName(this, name);
1704 } 1706 }
1705 1707
1708 void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader(
1709 const std::string& header) {
1710 frame_tree_node()->SetFeaturePolicyHeader(header);
1711 }
1712
1706 void RenderFrameHostImpl::OnDidAddContentSecurityPolicy( 1713 void RenderFrameHostImpl::OnDidAddContentSecurityPolicy(
1707 const ContentSecurityPolicyHeader& header) { 1714 const ContentSecurityPolicyHeader& header) {
1708 frame_tree_node()->AddContentSecurityPolicy(header); 1715 frame_tree_node()->AddContentSecurityPolicy(header);
1709 } 1716 }
1710 1717
1711 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy( 1718 void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy(
1712 blink::WebInsecureRequestPolicy policy) { 1719 blink::WebInsecureRequestPolicy policy) {
1713 frame_tree_node()->SetInsecureRequestPolicy(policy); 1720 frame_tree_node()->SetInsecureRequestPolicy(policy);
1714 } 1721 }
1715 1722
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 // There is no pending NavigationEntry in these cases, so pass 0 as the 3274 // There is no pending NavigationEntry in these cases, so pass 0 as the
3268 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3275 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3269 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3276 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3270 return NavigationHandleImpl::Create( 3277 return NavigationHandleImpl::Create(
3271 params.url, frame_tree_node_, is_renderer_initiated, 3278 params.url, frame_tree_node_, is_renderer_initiated,
3272 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), 3279 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
3273 entry_id_for_data_nav, false); // started_from_context_menu 3280 entry_id_for_data_nav, false); // started_from_context_menu
3274 } 3281 }
3275 3282
3276 } // namespace content 3283 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698