OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 blink::WebContentSecurityPolicyViolation violation; |
| 5232 violation.directive = WebString::fromASCII(violation_params.directive); |
| 5233 violation.effectiveDirective = |
| 5234 WebString::fromASCII(violation_params.effective_directive); |
| 5235 violation.consoleMessage = |
| 5236 WebString::fromASCII(violation_params.console_message); |
| 5237 violation.blockedUrl = violation_params.blocked_url; |
| 5238 violation.reportEndpoints = |
| 5239 WebVector<WebString>(violation_params.report_endpoints.size()); |
| 5240 for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) |
| 5241 violation.reportEndpoints[i] = |
| 5242 WebString::fromASCII(violation_params.report_endpoints[i]); |
| 5243 violation.header = WebString::fromASCII(violation_params.header); |
| 5244 violation.disposition = violation_params.disposition; |
| 5245 frame_->contentSecurityPolicyViolation(violation); |
| 5246 } |
| 5247 |
5226 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( | 5248 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
5227 const NavigationPolicyInfo& info) { | 5249 const NavigationPolicyInfo& info) { |
5228 // A content initiated navigation may have originated from a link-click, | 5250 // A content initiated navigation may have originated from a link-click, |
5229 // script, drag-n-drop operation, etc. | 5251 // script, drag-n-drop operation, etc. |
5230 // info.extraData is only non-null if this is a redirect. Use the extraData | 5252 // info.extraData is only non-null if this is a redirect. Use the extraData |
5231 // initiation information for redirects, and check pending_navigation_params_ | 5253 // initiation information for redirects, and check pending_navigation_params_ |
5232 // otherwise. | 5254 // otherwise. |
5233 bool is_content_initiated = | 5255 bool is_content_initiated = |
5234 info.extraData | 5256 info.extraData |
5235 ? static_cast<DocumentState*>(info.extraData) | 5257 ? static_cast<DocumentState*>(info.extraData) |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6829 // event target. Potentially a Pepper plugin will receive the event. | 6851 // 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 | 6852 // 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 | 6853 // 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 | 6854 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6833 // |pepper_last_mouse_event_target_|. | 6855 // |pepper_last_mouse_event_target_|. |
6834 pepper_last_mouse_event_target_ = nullptr; | 6856 pepper_last_mouse_event_target_ = nullptr; |
6835 #endif | 6857 #endif |
6836 } | 6858 } |
6837 | 6859 |
6838 } // namespace content | 6860 } // namespace content |
OLD | NEW |