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

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: Remove no longer applicable TODO and early exit from reportViolation method. 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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "content/child/service_worker/web_service_worker_provider_impl.h" 43 #include "content/child/service_worker/web_service_worker_provider_impl.h"
44 #include "content/child/v8_value_converter_impl.h" 44 #include "content/child/v8_value_converter_impl.h"
45 #include "content/child/web_url_loader_impl.h" 45 #include "content/child/web_url_loader_impl.h"
46 #include "content/child/web_url_request_util.h" 46 #include "content/child/web_url_request_util.h"
47 #include "content/child/webmessageportchannel_impl.h" 47 #include "content/child/webmessageportchannel_impl.h"
48 #include "content/child/websocket_bridge.h" 48 #include "content/child/websocket_bridge.h"
49 #include "content/child/weburlresponse_extradata_impl.h" 49 #include "content/child/weburlresponse_extradata_impl.h"
50 #include "content/common/accessibility_messages.h" 50 #include "content/common/accessibility_messages.h"
51 #include "content/common/clipboard_messages.h" 51 #include "content/common/clipboard_messages.h"
52 #include "content/common/content_constants_internal.h" 52 #include "content/common/content_constants_internal.h"
53 #include "content/common/content_security_policy_header.h" 53 #include "content/common/content_security_policy_structs.h"
54 #include "content/common/frame_messages.h" 54 #include "content/common/frame_messages.h"
55 #include "content/common/frame_owner_properties.h" 55 #include "content/common/frame_owner_properties.h"
56 #include "content/common/frame_replication_state.h" 56 #include "content/common/frame_replication_state.h"
57 #include "content/common/gpu/client/context_provider_command_buffer.h" 57 #include "content/common/gpu/client/context_provider_command_buffer.h"
58 #include "content/common/input_messages.h" 58 #include "content/common/input_messages.h"
59 #include "content/common/navigation_params.h" 59 #include "content/common/navigation_params.h"
60 #include "content/common/page_messages.h" 60 #include "content/common/page_messages.h"
61 #include "content/common/savable_subframe.h" 61 #include "content/common/savable_subframe.h"
62 #include "content/common/service_worker/service_worker_types.h" 62 #include "content/common/service_worker/service_worker_types.h"
63 #include "content/common/site_isolation_policy.h" 63 #include "content/common/site_isolation_policy.h"
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, 1564 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
1565 OnGetSerializedHtmlWithLocalLinks) 1565 OnGetSerializedHtmlWithLocalLinks)
1566 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) 1566 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML)
1567 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) 1567 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind)
1568 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) 1568 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch)
1569 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) 1569 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding)
1570 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1570 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1571 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, 1571 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs,
1572 OnSuppressFurtherDialogs) 1572 OnSuppressFurtherDialogs)
1573 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) 1573 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse)
1574 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation,
1575 OnReportContentSecurityPolicyViolation)
1574 #if defined(OS_ANDROID) 1576 #if defined(OS_ANDROID)
1575 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, 1577 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
1576 OnActivateNearestFindResult) 1578 OnActivateNearestFindResult)
1577 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, 1579 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
1578 OnGetNearestFindResult) 1580 OnGetNearestFindResult)
1579 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) 1581 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
1580 #endif 1582 #endif
1581 1583
1582 #if defined(USE_EXTERNAL_POPUP_MENU) 1584 #if defined(USE_EXTERNAL_POPUP_MENU)
1583 #if defined(OS_MACOSX) 1585 #if defined(OS_MACOSX)
(...skipping 3730 matching lines...) Expand 10 before | Expand all | Expand 10 after
5314 } 5316 }
5315 file_chooser_completions_.pop_front(); 5317 file_chooser_completions_.pop_front();
5316 5318
5317 // If there are more pending file chooser requests, schedule one now. 5319 // If there are more pending file chooser requests, schedule one now.
5318 if (!file_chooser_completions_.empty()) { 5320 if (!file_chooser_completions_.empty()) {
5319 Send(new FrameHostMsg_RunFileChooser( 5321 Send(new FrameHostMsg_RunFileChooser(
5320 routing_id_, file_chooser_completions_.front()->params)); 5322 routing_id_, file_chooser_completions_.front()->params));
5321 } 5323 }
5322 } 5324 }
5323 5325
5326 void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
5327 const ContentSecurityPolicyViolation& violation) {
5328 blink::WebVector<blink::WebString> web_report_endpoints(
5329 violation.report_endpoints.size());
5330 for (size_t i = 0; i < web_report_endpoints.size(); i++) {
5331 web_report_endpoints[i] =
5332 WebString::fromUTF8(violation.report_endpoints[i]);
5333 }
5334
5335 GetWebFrame()->reportContentSecurityPolicyViolation(
alexmos 2016/08/09 18:01:19 nit: this is fine, but most other code seems to ju
Łukasz Anforowicz 2016/08/09 22:23:20 Done.
5336 WebString::fromUTF8(violation.directive_text),
5337 WebString::fromUTF8(violation.effective_directive),
5338 WebString::fromUTF8(violation.console_message), violation.blocked_url,
5339 web_report_endpoints, WebString::fromUTF8(violation.header),
5340 violation.violation_type, violation.followed_redirect);
5341 }
5342
5324 #if defined(OS_ANDROID) 5343 #if defined(OS_ANDROID)
5325 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, 5344 void RenderFrameImpl::OnActivateNearestFindResult(int request_id,
5326 float x, 5345 float x,
5327 float y) { 5346 float y) {
5328 WebRect selection_rect; 5347 WebRect selection_rect;
5329 int ordinal = 5348 int ordinal =
5330 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); 5349 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect);
5331 if (ordinal == -1) { 5350 if (ordinal == -1) {
5332 // Something went wrong, so send a no-op reply (force the frame to report 5351 // Something went wrong, so send a no-op reply (force the frame to report
5333 // the current match count) in case the host is waiting for a response due 5352 // the current match count) in case the host is waiting for a response due
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
6340 // event target. Potentially a Pepper plugin will receive the event. 6359 // event target. Potentially a Pepper plugin will receive the event.
6341 // In order to tell whether a plugin gets the last mouse event and which it 6360 // In order to tell whether a plugin gets the last mouse event and which it
6342 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6361 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6343 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6362 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6344 // |pepper_last_mouse_event_target_|. 6363 // |pepper_last_mouse_event_target_|.
6345 pepper_last_mouse_event_target_ = nullptr; 6364 pepper_last_mouse_event_target_ = nullptr;
6346 #endif 6365 #endif
6347 } 6366 }
6348 6367
6349 } // namespace content 6368 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698