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

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 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) 1564 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
1564 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) 1565 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
1565 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, 1566 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
1566 OnSetFrameOwnerProperties) 1567 OnSetFrameOwnerProperties)
1567 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) 1568 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus)
1568 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) 1569 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame)
1569 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, 1570 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
1570 OnTextTrackSettingsChanged) 1571 OnTextTrackSettingsChanged)
1571 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) 1572 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
1572 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) 1573 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
1574 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1575 OnReportContentSecurityPolicyViolation)
1573 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, 1576 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
1574 OnGetSavableResourceLinks) 1577 OnGetSavableResourceLinks)
1575 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1578 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1576 OnGetSerializedHtmlWithLocalLinks) 1579 OnGetSerializedHtmlWithLocalLinks)
1577 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1580 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1578 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1581 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1579 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1582 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1580 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1583 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1581 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1584 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1582 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1585 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
(...skipping 3648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5231 history_entry = PageStateToHistoryEntry(request_params.page_state); 5234 history_entry = PageStateToHistoryEntry(request_params.page_state);
5232 5235
5233 // For renderer initiated navigations, we send out a didFailProvisionalLoad() 5236 // For renderer initiated navigations, we send out a didFailProvisionalLoad()
5234 // notification. 5237 // notification.
5235 if (request_params.nav_entry_id == 0) 5238 if (request_params.nav_entry_id == 0)
5236 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit); 5239 didFailProvisionalLoad(frame_, error, blink::WebStandardCommit);
5237 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get()); 5240 LoadNavigationErrorPage(failed_request, error, replace, history_entry.get());
5238 browser_side_navigation_pending_ = false; 5241 browser_side_navigation_pending_ = false;
5239 } 5242 }
5240 5243
5244 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5245 const content::CSPViolationParams& violation_params) {
5246 frame_->reportContentSecurityPolicyViolation(
5247 BuildWebContentSecurityPolicyViolation(violation_params));
5248 }
5249
5241 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( 5250 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
5242 const NavigationPolicyInfo& info) { 5251 const NavigationPolicyInfo& info) {
5243 // A content initiated navigation may have originated from a link-click, 5252 // A content initiated navigation may have originated from a link-click,
5244 // script, drag-n-drop operation, etc. 5253 // script, drag-n-drop operation, etc.
5245 // info.extraData is only non-null if this is a redirect. Use the extraData 5254 // info.extraData is only non-null if this is a redirect. Use the extraData
5246 // initiation information for redirects, and check pending_navigation_params_ 5255 // initiation information for redirects, and check pending_navigation_params_
5247 // otherwise. 5256 // otherwise.
5248 bool is_content_initiated = 5257 bool is_content_initiated =
5249 info.extraData 5258 info.extraData
5250 ? static_cast<DocumentState*>(info.extraData) 5259 ? static_cast<DocumentState*>(info.extraData)
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
6859 // event target. Potentially a Pepper plugin will receive the event. 6868 // event target. Potentially a Pepper plugin will receive the event.
6860 // In order to tell whether a plugin gets the last mouse event and which it 6869 // In order to tell whether a plugin gets the last mouse event and which it
6861 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6870 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6862 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6871 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6863 // |pepper_last_mouse_event_target_|. 6872 // |pepper_last_mouse_event_target_|.
6864 pepper_last_mouse_event_target_ = nullptr; 6873 pepper_last_mouse_event_target_ = nullptr;
6865 #endif 6874 #endif
6866 } 6875 }
6867 6876
6868 } // namespace content 6877 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698