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

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

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sanitize report endpoints from IPC against actual CSP contents. Created 4 years, 4 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/child/service_worker/web_service_worker_provider_impl.h" 42 #include "content/child/service_worker/web_service_worker_provider_impl.h"
43 #include "content/child/v8_value_converter_impl.h" 43 #include "content/child/v8_value_converter_impl.h"
44 #include "content/child/web_url_loader_impl.h" 44 #include "content/child/web_url_loader_impl.h"
45 #include "content/child/web_url_request_util.h" 45 #include "content/child/web_url_request_util.h"
46 #include "content/child/webmessageportchannel_impl.h" 46 #include "content/child/webmessageportchannel_impl.h"
47 #include "content/child/websocket_bridge.h" 47 #include "content/child/websocket_bridge.h"
48 #include "content/child/weburlresponse_extradata_impl.h" 48 #include "content/child/weburlresponse_extradata_impl.h"
49 #include "content/common/accessibility_messages.h" 49 #include "content/common/accessibility_messages.h"
50 #include "content/common/clipboard_messages.h" 50 #include "content/common/clipboard_messages.h"
51 #include "content/common/content_constants_internal.h" 51 #include "content/common/content_constants_internal.h"
52 #include "content/common/content_security_policy_header.h" 52 #include "content/common/content_security_policy_structs.h"
53 #include "content/common/frame_messages.h" 53 #include "content/common/frame_messages.h"
54 #include "content/common/frame_owner_properties.h" 54 #include "content/common/frame_owner_properties.h"
55 #include "content/common/frame_replication_state.h" 55 #include "content/common/frame_replication_state.h"
56 #include "content/common/gpu/client/context_provider_command_buffer.h" 56 #include "content/common/gpu/client/context_provider_command_buffer.h"
57 #include "content/common/input_messages.h" 57 #include "content/common/input_messages.h"
58 #include "content/common/navigation_params.h" 58 #include "content/common/navigation_params.h"
59 #include "content/common/page_messages.h" 59 #include "content/common/page_messages.h"
60 #include "content/common/savable_subframe.h" 60 #include "content/common/savable_subframe.h"
61 #include "content/common/service_worker/service_worker_types.h" 61 #include "content/common/service_worker/service_worker_types.h"
62 #include "content/common/site_isolation_policy.h" 62 #include "content/common/site_isolation_policy.h"
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1523 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1524 OnGetSerializedHtmlWithLocalLinks) 1524 OnGetSerializedHtmlWithLocalLinks)
1525 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1525 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1526 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1526 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1527 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1527 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1528 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1528 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1529 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1529 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1530 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1530 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
1531 OnSuppressFurtherDialogs) 1531 OnSuppressFurtherDialogs)
1532 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) 1532 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse)
1533 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1534 OnReportContentSecurityPolicyViolation)
1533 #if defined(OS_ANDROID) 1535 #if defined(OS_ANDROID)
1534 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, 1536 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
1535 OnActivateNearestFindResult) 1537 OnActivateNearestFindResult)
1536 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, 1538 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
1537 OnGetNearestFindResult) 1539 OnGetNearestFindResult)
1538 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) 1540 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
1539 #endif 1541 #endif
1540 1542
1541 #if defined(USE_EXTERNAL_POPUP_MENU) 1543 #if defined(USE_EXTERNAL_POPUP_MENU)
1542 #if defined(OS_MACOSX) 1544 #if defined(OS_MACOSX)
(...skipping 3690 matching lines...) Expand 10 before | Expand all | Expand 10 after
5233 } 5235 }
5234 file_chooser_completions_.pop_front(); 5236 file_chooser_completions_.pop_front();
5235 5237
5236 // If there are more pending file chooser requests, schedule one now. 5238 // If there are more pending file chooser requests, schedule one now.
5237 if (!file_chooser_completions_.empty()) { 5239 if (!file_chooser_completions_.empty()) {
5238 Send(new FrameHostMsg_RunFileChooser( 5240 Send(new FrameHostMsg_RunFileChooser(
5239 routing_id_, file_chooser_completions_.front()->params)); 5241 routing_id_, file_chooser_completions_.front()->params));
5240 } 5242 }
5241 } 5243 }
5242 5244
5245 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5246 const ContentSecurityPolicyViolation& violation) {
5247 blink::WebVector<blink::WebString> web_report_endpoints(
5248 violation.report_endpoints.size());
5249 for (size_t i = 0; i < web_report_endpoints.size(); i++) {
5250 web_report_endpoints[i] =
5251 WebString::fromUTF8(violation.report_endpoints[i]);
5252 }
5253
5254 frame_->reportContentSecurityPolicyViolation(
5255 WebString::fromUTF8(violation.directive_text),
5256 WebString::fromUTF8(violation.effective_directive),
5257 WebString::fromUTF8(violation.console_message), violation.blocked_url,
5258 web_report_endpoints, WebString::fromUTF8(violation.header),
5259 violation.violation_type, violation.followed_redirect);
5260 }
5261
5243 #if defined(OS_ANDROID) 5262 #if defined(OS_ANDROID)
5244 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, 5263 void RenderFrameImpl::OnActivateNearestFindResult(int request_id,
5245 float x, 5264 float x,
5246 float y) { 5265 float y) {
5247 WebRect selection_rect; 5266 WebRect selection_rect;
5248 int ordinal = 5267 int ordinal =
5249 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); 5268 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect);
5250 if (ordinal == -1) { 5269 if (ordinal == -1) {
5251 // Something went wrong, so send a no-op reply (force the frame to report 5270 // Something went wrong, so send a no-op reply (force the frame to report
5252 // the current match count) in case the host is waiting for a response due 5271 // the current match count) in case the host is waiting for a response due
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
6297 // event target. Potentially a Pepper plugin will receive the event. 6316 // event target. Potentially a Pepper plugin will receive the event.
6298 // In order to tell whether a plugin gets the last mouse event and which it 6317 // In order to tell whether a plugin gets the last mouse event and which it
6299 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6318 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6300 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6319 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6301 // |pepper_last_mouse_event_target_|. 6320 // |pepper_last_mouse_event_target_|.
6302 pepper_last_mouse_event_target_ = nullptr; 6321 pepper_last_mouse_event_target_ = nullptr;
6303 #endif 6322 #endif
6304 } 6323 }
6305 6324
6306 } // namespace content 6325 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698