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

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

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Add TODO in the FrameLoader. 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 657
658 const RequestExtraData* extra_data = 658 const RequestExtraData* extra_data =
659 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); 659 static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
660 DCHECK(extra_data); 660 DCHECK(extra_data);
661 return CommonNavigationParams( 661 return CommonNavigationParams(
662 info.urlRequest.url(), referrer, extra_data->transition_type(), 662 info.urlRequest.url(), referrer, extra_data->transition_type(),
663 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, 663 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
664 report_type, GURL(), GURL(), 664 report_type, GURL(), GURL(),
665 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), 665 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
666 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), 666 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
667 GetRequestBodyForWebURLRequest(info.urlRequest)); 667 GetRequestBodyForWebURLRequest(info.urlRequest),
668 info.shouldBypassMainWorldCSP);
668 } 669 }
669 670
670 media::Context3D GetSharedMainThreadContext3D( 671 media::Context3D GetSharedMainThreadContext3D(
671 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { 672 scoped_refptr<ui::ContextProviderCommandBuffer> provider) {
672 if (!provider) 673 if (!provider)
673 return media::Context3D(); 674 return media::Context3D();
674 return media::Context3D(provider->ContextGL(), provider->GrContext()); 675 return media::Context3D(provider->ContextGL(), provider->GrContext());
675 } 676 }
676 677
677 WebFrameLoadType ReloadFrameLoadTypeFor( 678 WebFrameLoadType ReloadFrameLoadTypeFor(
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) 1546 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
1546 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) 1547 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
1547 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, 1548 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
1548 OnSetFrameOwnerProperties) 1549 OnSetFrameOwnerProperties)
1549 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) 1550 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus)
1550 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) 1551 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame)
1551 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, 1552 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
1552 OnTextTrackSettingsChanged) 1553 OnTextTrackSettingsChanged)
1553 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) 1554 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
1554 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) 1555 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
1556 IPC_MESSAGE_HANDLER(FrameMsg_ContentSecurityPolicyViolation,
1557 OnContentSecurityPolicyViolation)
1555 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, 1558 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
1556 OnGetSavableResourceLinks) 1559 OnGetSavableResourceLinks)
1557 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1560 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1558 OnGetSerializedHtmlWithLocalLinks) 1561 OnGetSerializedHtmlWithLocalLinks)
1559 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1562 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1560 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1563 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1561 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1564 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1562 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1565 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1563 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1566 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1564 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1567 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
(...skipping 3651 matching lines...) Expand 10 before | Expand all | Expand 10 after
5216 history_entry = PageStateToHistoryEntry(request_params.page_state); 5219 history_entry = PageStateToHistoryEntry(request_params.page_state);
5217 5220
5218 // For renderer initiated navigations, we send out a didFailProvisionalLoad() 5221 // For renderer initiated navigations, we send out a didFailProvisionalLoad()
5219 // notification. 5222 // notification.
5220 if (request_params.nav_entry_id == 0) 5223 if (request_params.nav_entry_id == 0)
5221 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit); 5224 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit);
5222 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get()); 5225 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get());
5223 browser_side_navigation_pending_ = false; 5226 browser_side_navigation_pending_ = false;
5224 } 5227 }
5225 5228
5229 void RenderFrameImpl::OnContentSecurityPolicyViolation(
5230 const content::CSPViolationParams& violation_params) {
5231 frame_->contentSecurityPolicyViolation(
5232 BuildWebContentSecurityPolicyViolation(violation_params));
5233 }
5234
5226 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( 5235 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
5227 const NavigationPolicyInfo& info) { 5236 const NavigationPolicyInfo& info) {
5228 // A content initiated navigation may have originated from a link-click, 5237 // A content initiated navigation may have originated from a link-click,
5229 // script, drag-n-drop operation, etc. 5238 // script, drag-n-drop operation, etc.
5230 // info.extraData is only non-null if this is a redirect. Use the extraData 5239 // info.extraData is only non-null if this is a redirect. Use the extraData
5231 // initiation information for redirects, and check pending_navigation_params_ 5240 // initiation information for redirects, and check pending_navigation_params_
5232 // otherwise. 5241 // otherwise.
5233 bool is_content_initiated = 5242 bool is_content_initiated =
5234 info.extraData 5243 info.extraData
5235 ? static_cast<DocumentState*>(info.extraData) 5244 ? static_cast<DocumentState*>(info.extraData)
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after
6829 // event target. Potentially a Pepper plugin will receive the event. 6838 // event target. Potentially a Pepper plugin will receive the event.
6830 // In order to tell whether a plugin gets the last mouse event and which it 6839 // In order to tell whether a plugin gets the last mouse event and which it
6831 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6840 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6832 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6841 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6833 // |pepper_last_mouse_event_target_|. 6842 // |pepper_last_mouse_event_target_|.
6834 pepper_last_mouse_event_target_ = nullptr; 6843 pepper_last_mouse_event_target_ = nullptr;
6835 #endif 6844 #endif
6836 } 6845 }
6837 6846
6838 } // namespace content 6847 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698