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

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 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 679
680 const RequestExtraData* extra_data = 680 const RequestExtraData* extra_data =
681 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); 681 static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
682 DCHECK(extra_data); 682 DCHECK(extra_data);
683 return CommonNavigationParams( 683 return CommonNavigationParams(
684 info.urlRequest.url(), referrer, extra_data->transition_type(), 684 info.urlRequest.url(), referrer, extra_data->transition_type(),
685 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, 685 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
686 report_type, GURL(), GURL(), 686 report_type, GURL(), GURL(),
687 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), 687 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
688 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), 688 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
689 GetRequestBodyForWebURLRequest(info.urlRequest)); 689 GetRequestBodyForWebURLRequest(info.urlRequest),
690 info.shouldBypassMainWorldCSP);
690 } 691 }
691 692
692 media::Context3D GetSharedMainThreadContext3D( 693 media::Context3D GetSharedMainThreadContext3D(
693 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { 694 scoped_refptr<ui::ContextProviderCommandBuffer> provider) {
694 if (!provider) 695 if (!provider)
695 return media::Context3D(); 696 return media::Context3D();
696 return media::Context3D(provider->ContextGL(), provider->GrContext()); 697 return media::Context3D(provider->ContextGL(), provider->GrContext());
697 } 698 }
698 699
699 WebFrameLoadType ReloadFrameLoadTypeFor( 700 WebFrameLoadType ReloadFrameLoadTypeFor(
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) 1565 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
1565 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) 1566 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
1566 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, 1567 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
1567 OnSetFrameOwnerProperties) 1568 OnSetFrameOwnerProperties)
1568 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) 1569 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus)
1569 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) 1570 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame)
1570 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, 1571 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
1571 OnTextTrackSettingsChanged) 1572 OnTextTrackSettingsChanged)
1572 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) 1573 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
1573 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) 1574 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
1575 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1576 OnReportContentSecurityPolicyViolation)
1574 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, 1577 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
1575 OnGetSavableResourceLinks) 1578 OnGetSavableResourceLinks)
1576 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1579 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1577 OnGetSerializedHtmlWithLocalLinks) 1580 OnGetSerializedHtmlWithLocalLinks)
1578 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1581 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1579 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1582 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1580 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1583 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1581 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1584 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1582 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1585 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1583 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1586 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
(...skipping 3670 matching lines...) Expand 10 before | Expand all | Expand 10 after
5254 // provisionalDataSource(), LoadNavigationErrorPage wasn't called, so do it 5257 // provisionalDataSource(), LoadNavigationErrorPage wasn't called, so do it
5255 // now. 5258 // now.
5256 if (request_params.nav_entry_id != 0 || !had_provisional_data_source) { 5259 if (request_params.nav_entry_id != 0 || !had_provisional_data_source) {
5257 LoadNavigationErrorPage(failed_request, error, replace, 5260 LoadNavigationErrorPage(failed_request, error, replace,
5258 history_entry.get()); 5261 history_entry.get());
5259 } 5262 }
5260 5263
5261 browser_side_navigation_pending_ = false; 5264 browser_side_navigation_pending_ = false;
5262 } 5265 }
5263 5266
5267 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5268 const content::CSPViolationParams& violation_params) {
5269 frame_->reportContentSecurityPolicyViolation(
5270 BuildWebContentSecurityPolicyViolation(violation_params));
5271 }
5272
5264 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( 5273 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
5265 const NavigationPolicyInfo& info) { 5274 const NavigationPolicyInfo& info) {
5266 // A content initiated navigation may have originated from a link-click, 5275 // A content initiated navigation may have originated from a link-click,
5267 // script, drag-n-drop operation, etc. 5276 // script, drag-n-drop operation, etc.
5268 // info.extraData is only non-null if this is a redirect. Use the extraData 5277 // info.extraData is only non-null if this is a redirect. Use the extraData
5269 // initiation information for redirects, and check pending_navigation_params_ 5278 // initiation information for redirects, and check pending_navigation_params_
5270 // otherwise. 5279 // otherwise.
5271 bool is_content_initiated = 5280 bool is_content_initiated =
5272 info.extraData 5281 info.extraData
5273 ? static_cast<DocumentState*>(info.extraData) 5282 ? static_cast<DocumentState*>(info.extraData)
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
6893 // event target. Potentially a Pepper plugin will receive the event. 6902 // event target. Potentially a Pepper plugin will receive the event.
6894 // In order to tell whether a plugin gets the last mouse event and which it 6903 // In order to tell whether a plugin gets the last mouse event and which it
6895 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6904 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6896 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6905 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6897 // |pepper_last_mouse_event_target_|. 6906 // |pepper_last_mouse_event_target_|.
6898 pepper_last_mouse_event_target_ = nullptr; 6907 pepper_last_mouse_event_target_ = nullptr;
6899 #endif 6908 #endif
6900 } 6909 }
6901 6910
6902 } // namespace content 6911 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698