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

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

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Rebase. Created 3 years, 10 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 673
674 const RequestExtraData* extra_data = 674 const RequestExtraData* extra_data =
675 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); 675 static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
676 DCHECK(extra_data); 676 DCHECK(extra_data);
677 return CommonNavigationParams( 677 return CommonNavigationParams(
678 info.urlRequest.url(), referrer, extra_data->transition_type(), 678 info.urlRequest.url(), referrer, extra_data->transition_type(),
679 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, 679 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
680 report_type, GURL(), GURL(), 680 report_type, GURL(), GURL(),
681 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), 681 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
682 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), 682 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
683 GetRequestBodyForWebURLRequest(info.urlRequest)); 683 GetRequestBodyForWebURLRequest(info.urlRequest),
684 info.shouldBypassMainWorldCSP);
684 } 685 }
685 686
686 media::Context3D GetSharedMainThreadContext3D( 687 media::Context3D GetSharedMainThreadContext3D(
687 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { 688 scoped_refptr<ui::ContextProviderCommandBuffer> provider) {
688 if (!provider) 689 if (!provider)
689 return media::Context3D(); 690 return media::Context3D();
690 return media::Context3D(provider->ContextGL(), provider->GrContext()); 691 return media::Context3D(provider->ContextGL(), provider->GrContext());
691 } 692 }
692 693
693 WebFrameLoadType ReloadFrameLoadTypeFor( 694 WebFrameLoadType ReloadFrameLoadTypeFor(
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) 1560 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
1560 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) 1561 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
1561 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, 1562 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
1562 OnSetFrameOwnerProperties) 1563 OnSetFrameOwnerProperties)
1563 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) 1564 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus)
1564 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) 1565 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame)
1565 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, 1566 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
1566 OnTextTrackSettingsChanged) 1567 OnTextTrackSettingsChanged)
1567 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) 1568 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
1568 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) 1569 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
1570 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1571 OnReportContentSecurityPolicyViolation)
1569 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, 1572 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
1570 OnGetSavableResourceLinks) 1573 OnGetSavableResourceLinks)
1571 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1574 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1572 OnGetSerializedHtmlWithLocalLinks) 1575 OnGetSerializedHtmlWithLocalLinks)
1573 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1576 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1574 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1577 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1575 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1578 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1576 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1579 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1577 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1580 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1578 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1581 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
(...skipping 3660 matching lines...) Expand 10 before | Expand all | Expand 10 after
5239 history_entry = PageStateToHistoryEntry(request_params.page_state); 5242 history_entry = PageStateToHistoryEntry(request_params.page_state);
5240 5243
5241 // For renderer initiated navigations, we send out a didFailProvisionalLoad() 5244 // For renderer initiated navigations, we send out a didFailProvisionalLoad()
5242 // notification. 5245 // notification.
5243 if (request_params.nav_entry_id == 0) 5246 if (request_params.nav_entry_id == 0)
5244 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit); 5247 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit);
5245 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get()); 5248 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get());
5246 browser_side_navigation_pending_ = false; 5249 browser_side_navigation_pending_ = false;
5247 } 5250 }
5248 5251
5252 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5253 const content::CSPViolationParams& violation_params) {
5254 frame_->reportContentSecurityPolicyViolation(
5255 BuildWebContentSecurityPolicyViolation(violation_params));
5256 }
5257
5249 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( 5258 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
5250 const NavigationPolicyInfo& info) { 5259 const NavigationPolicyInfo& info) {
5251 // A content initiated navigation may have originated from a link-click, 5260 // A content initiated navigation may have originated from a link-click,
5252 // script, drag-n-drop operation, etc. 5261 // script, drag-n-drop operation, etc.
5253 // info.extraData is only non-null if this is a redirect. Use the extraData 5262 // info.extraData is only non-null if this is a redirect. Use the extraData
5254 // initiation information for redirects, and check pending_navigation_params_ 5263 // initiation information for redirects, and check pending_navigation_params_
5255 // otherwise. 5264 // otherwise.
5256 bool is_content_initiated = 5265 bool is_content_initiated =
5257 info.extraData 5266 info.extraData
5258 ? static_cast<DocumentState*>(info.extraData) 5267 ? static_cast<DocumentState*>(info.extraData)
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
6869 // event target. Potentially a Pepper plugin will receive the event. 6878 // event target. Potentially a Pepper plugin will receive the event.
6870 // In order to tell whether a plugin gets the last mouse event and which it 6879 // In order to tell whether a plugin gets the last mouse event and which it
6871 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6880 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6872 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6881 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6873 // |pepper_last_mouse_event_target_|. 6882 // |pepper_last_mouse_event_target_|.
6874 pepper_last_mouse_event_target_ = nullptr; 6883 pepper_last_mouse_event_target_ = nullptr;
6875 #endif 6884 #endif
6876 } 6885 }
6877 6886
6878 } // namespace content 6887 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698