| 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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 navigation_type = FrameMsg_Navigate_Type::RELOAD; | 677 navigation_type = FrameMsg_Navigate_Type::RELOAD; |
| 678 } | 678 } |
| 679 | 679 |
| 680 base::Optional<SourceLocation> source_location; | 680 base::Optional<SourceLocation> source_location; |
| 681 if (!info.sourceLocation.url.isNull()) { | 681 if (!info.sourceLocation.url.isNull()) { |
| 682 source_location = SourceLocation(info.sourceLocation.url.latin1(), | 682 source_location = SourceLocation(info.sourceLocation.url.latin1(), |
| 683 info.sourceLocation.lineNumber, | 683 info.sourceLocation.lineNumber, |
| 684 info.sourceLocation.columnNumber); | 684 info.sourceLocation.columnNumber); |
| 685 } | 685 } |
| 686 | 686 |
| 687 CSPDisposition should_check_main_world_csp = | |
| 688 info.shouldCheckMainWorldContentSecurityPolicy == | |
| 689 blink::WebContentSecurityPolicyDispositionCheck | |
| 690 ? CSPDisposition::CHECK | |
| 691 : CSPDisposition::DO_NOT_CHECK; | |
| 692 | |
| 693 const RequestExtraData* extra_data = | 687 const RequestExtraData* extra_data = |
| 694 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); | 688 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); |
| 695 DCHECK(extra_data); | 689 DCHECK(extra_data); |
| 696 return CommonNavigationParams( | 690 return CommonNavigationParams( |
| 697 info.urlRequest.url(), referrer, extra_data->transition_type(), | 691 info.urlRequest.url(), referrer, extra_data->transition_type(), |
| 698 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, | 692 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, |
| 699 report_type, GURL(), GURL(), | 693 report_type, GURL(), GURL(), |
| 700 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), | 694 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), |
| 701 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), | 695 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), |
| 702 GetRequestBodyForWebURLRequest(info.urlRequest), source_location, | 696 GetRequestBodyForWebURLRequest(info.urlRequest), source_location); |
| 703 should_check_main_world_csp); | |
| 704 } | 697 } |
| 705 | 698 |
| 706 media::Context3D GetSharedMainThreadContext3D( | 699 media::Context3D GetSharedMainThreadContext3D( |
| 707 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { | 700 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { |
| 708 if (!provider) | 701 if (!provider) |
| 709 return media::Context3D(); | 702 return media::Context3D(); |
| 710 return media::Context3D(provider->ContextGL(), provider->GrContext()); | 703 return media::Context3D(provider->ContextGL(), provider->GrContext()); |
| 711 } | 704 } |
| 712 | 705 |
| 713 WebFrameLoadType ReloadFrameLoadTypeFor( | 706 WebFrameLoadType ReloadFrameLoadTypeFor( |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1571 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1579 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1572 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 1580 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, | 1573 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
| 1581 OnSetFrameOwnerProperties) | 1574 OnSetFrameOwnerProperties) |
| 1582 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) | 1575 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) |
| 1583 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) | 1576 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) |
| 1584 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, | 1577 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, |
| 1585 OnTextTrackSettingsChanged) | 1578 OnTextTrackSettingsChanged) |
| 1586 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) | 1579 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) |
| 1587 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) | 1580 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) |
| 1588 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, | |
| 1589 OnReportContentSecurityPolicyViolation) | |
| 1590 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, | 1581 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, |
| 1591 OnGetSavableResourceLinks) | 1582 OnGetSavableResourceLinks) |
| 1592 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, | 1583 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, |
| 1593 OnGetSerializedHtmlWithLocalLinks) | 1584 OnGetSerializedHtmlWithLocalLinks) |
| 1594 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) | 1585 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) |
| 1595 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) | 1586 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
| 1596 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) | 1587 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) |
| 1597 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) | 1588 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
| 1598 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1589 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 1599 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, | 1590 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
| (...skipping 3659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5259 // provisionalDataSource(), LoadNavigationErrorPage wasn't called, so do it | 5250 // provisionalDataSource(), LoadNavigationErrorPage wasn't called, so do it |
| 5260 // now. | 5251 // now. |
| 5261 if (request_params.nav_entry_id != 0 || !had_provisional_data_source) { | 5252 if (request_params.nav_entry_id != 0 || !had_provisional_data_source) { |
| 5262 LoadNavigationErrorPage(failed_request, error, replace, | 5253 LoadNavigationErrorPage(failed_request, error, replace, |
| 5263 history_entry.get()); | 5254 history_entry.get()); |
| 5264 } | 5255 } |
| 5265 | 5256 |
| 5266 browser_side_navigation_pending_ = false; | 5257 browser_side_navigation_pending_ = false; |
| 5267 } | 5258 } |
| 5268 | 5259 |
| 5269 void RenderFrameImpl::OnReportContentSecurityPolicyViolation( | |
| 5270 const content::CSPViolationParams& violation_params) { | |
| 5271 frame_->reportContentSecurityPolicyViolation( | |
| 5272 BuildWebContentSecurityPolicyViolation(violation_params)); | |
| 5273 } | |
| 5274 | |
| 5275 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( | 5260 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
| 5276 const NavigationPolicyInfo& info) { | 5261 const NavigationPolicyInfo& info) { |
| 5277 // A content initiated navigation may have originated from a link-click, | 5262 // A content initiated navigation may have originated from a link-click, |
| 5278 // script, drag-n-drop operation, etc. | 5263 // script, drag-n-drop operation, etc. |
| 5279 // info.extraData is only non-null if this is a redirect. Use the extraData | 5264 // info.extraData is only non-null if this is a redirect. Use the extraData |
| 5280 // initiation information for redirects, and check pending_navigation_params_ | 5265 // initiation information for redirects, and check pending_navigation_params_ |
| 5281 // otherwise. | 5266 // otherwise. |
| 5282 bool is_content_initiated = | 5267 bool is_content_initiated = |
| 5283 info.extraData | 5268 info.extraData |
| 5284 ? static_cast<DocumentState*>(info.extraData) | 5269 ? static_cast<DocumentState*>(info.extraData) |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6912 // event target. Potentially a Pepper plugin will receive the event. | 6897 // event target. Potentially a Pepper plugin will receive the event. |
| 6913 // In order to tell whether a plugin gets the last mouse event and which it | 6898 // In order to tell whether a plugin gets the last mouse event and which it |
| 6914 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6899 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6915 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6900 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6916 // |pepper_last_mouse_event_target_|. | 6901 // |pepper_last_mouse_event_target_|. |
| 6917 pepper_last_mouse_event_target_ = nullptr; | 6902 pepper_last_mouse_event_target_ = nullptr; |
| 6918 #endif | 6903 #endif |
| 6919 } | 6904 } |
| 6920 | 6905 |
| 6921 } // namespace content | 6906 } // namespace content |
| OLD | NEW |