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

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

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Addressed comments @alexmos. 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/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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 677
678 const RequestExtraData* extra_data = 678 const RequestExtraData* extra_data =
679 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); 679 static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
680 DCHECK(extra_data); 680 DCHECK(extra_data);
681 return CommonNavigationParams( 681 return CommonNavigationParams(
682 info.urlRequest.url(), referrer, extra_data->transition_type(), 682 info.urlRequest.url(), referrer, extra_data->transition_type(),
683 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, 683 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
684 report_type, GURL(), GURL(), 684 report_type, GURL(), GURL(),
685 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), 685 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
686 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), 686 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
687 GetRequestBodyForWebURLRequest(info.urlRequest)); 687 GetRequestBodyForWebURLRequest(info.urlRequest),
688 info.shouldBypassMainWorldCSP);
688 } 689 }
689 690
690 media::Context3D GetSharedMainThreadContext3D( 691 media::Context3D GetSharedMainThreadContext3D(
691 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { 692 scoped_refptr<ui::ContextProviderCommandBuffer> provider) {
692 if (!provider) 693 if (!provider)
693 return media::Context3D(); 694 return media::Context3D();
694 return media::Context3D(provider->ContextGL(), provider->GrContext()); 695 return media::Context3D(provider->ContextGL(), provider->GrContext());
695 } 696 }
696 697
697 WebFrameLoadType ReloadFrameLoadTypeFor( 698 WebFrameLoadType ReloadFrameLoadTypeFor(
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) 1562 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
1562 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) 1563 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
1563 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, 1564 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
1564 OnSetFrameOwnerProperties) 1565 OnSetFrameOwnerProperties)
1565 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) 1566 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus)
1566 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) 1567 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame)
1567 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, 1568 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
1568 OnTextTrackSettingsChanged) 1569 OnTextTrackSettingsChanged)
1569 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) 1570 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
1570 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) 1571 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
1572 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1573 OnReportContentSecurityPolicyViolation)
1571 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, 1574 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
1572 OnGetSavableResourceLinks) 1575 OnGetSavableResourceLinks)
1573 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1576 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1574 OnGetSerializedHtmlWithLocalLinks) 1577 OnGetSerializedHtmlWithLocalLinks)
1575 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1578 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1576 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1579 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1577 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1580 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1578 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1581 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1579 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1582 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1580 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1583 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
(...skipping 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 history_entry = PageStateToHistoryEntry(request_params.page_state); 5216 history_entry = PageStateToHistoryEntry(request_params.page_state);
5214 5217
5215 // For renderer initiated navigations, we send out a didFailProvisionalLoad() 5218 // For renderer initiated navigations, we send out a didFailProvisionalLoad()
5216 // notification. 5219 // notification.
5217 if (request_params.nav_entry_id == 0) 5220 if (request_params.nav_entry_id == 0)
5218 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit); 5221 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit);
5219 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get()); 5222 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get());
5220 browser_side_navigation_pending_ = false; 5223 browser_side_navigation_pending_ = false;
5221 } 5224 }
5222 5225
5226 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5227 const content::CSPViolationParams& violation_params) {
5228 frame_->reportContentSecurityPolicyViolation(
5229 BuildWebContentSecurityPolicyViolation(violation_params));
5230 }
5231
5223 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( 5232 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
5224 const NavigationPolicyInfo& info) { 5233 const NavigationPolicyInfo& info) {
5225 // A content initiated navigation may have originated from a link-click, 5234 // A content initiated navigation may have originated from a link-click,
5226 // script, drag-n-drop operation, etc. 5235 // script, drag-n-drop operation, etc.
5227 // info.extraData is only non-null if this is a redirect. Use the extraData 5236 // info.extraData is only non-null if this is a redirect. Use the extraData
5228 // initiation information for redirects, and check pending_navigation_params_ 5237 // initiation information for redirects, and check pending_navigation_params_
5229 // otherwise. 5238 // otherwise.
5230 bool is_content_initiated = 5239 bool is_content_initiated =
5231 info.extraData 5240 info.extraData
5232 ? static_cast<DocumentState*>(info.extraData) 5241 ? static_cast<DocumentState*>(info.extraData)
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
6841 // event target. Potentially a Pepper plugin will receive the event. 6850 // event target. Potentially a Pepper plugin will receive the event.
6842 // In order to tell whether a plugin gets the last mouse event and which it 6851 // In order to tell whether a plugin gets the last mouse event and which it
6843 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6852 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6844 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6853 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6845 // |pepper_last_mouse_event_target_|. 6854 // |pepper_last_mouse_event_target_|.
6846 pepper_last_mouse_event_target_ = nullptr; 6855 pepper_last_mouse_event_target_ = nullptr;
6847 #endif 6856 #endif
6848 } 6857 }
6849 6858
6850 } // namespace content 6859 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698