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

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

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing how virtual method is declared. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_proxy.h" 5 #include "content/renderer/render_frame_proxy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "content/child/web_url_request_util.h" 13 #include "content/child/web_url_request_util.h"
14 #include "content/child/webmessageportchannel_impl.h" 14 #include "content/child/webmessageportchannel_impl.h"
15 #include "content/common/content_security_policy_header.h" 15 #include "content/common/content_security_policy_structs.h"
16 #include "content/common/frame_messages.h" 16 #include "content/common/frame_messages.h"
17 #include "content/common/frame_owner_properties.h" 17 #include "content/common/frame_owner_properties.h"
18 #include "content/common/frame_replication_state.h" 18 #include "content/common/frame_replication_state.h"
19 #include "content/common/input_messages.h" 19 #include "content/common/input_messages.h"
20 #include "content/common/page_messages.h" 20 #include "content/common/page_messages.h"
21 #include "content/common/site_isolation_policy.h" 21 #include "content/common/site_isolation_policy.h"
22 #include "content/common/swapped_out_messages.h" 22 #include "content/common/swapped_out_messages.h"
23 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
24 #include "content/renderer/child_frame_compositing_helper.h" 24 #include "content/renderer/child_frame_compositing_helper.h"
25 #include "content/renderer/render_frame_impl.h" 25 #include "content/renderer/render_frame_impl.h"
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 void RenderFrameProxy::advanceFocus(blink::WebFocusType type, 493 void RenderFrameProxy::advanceFocus(blink::WebFocusType type,
494 blink::WebLocalFrame* source) { 494 blink::WebLocalFrame* source) {
495 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); 495 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID();
496 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); 496 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id));
497 } 497 }
498 498
499 void RenderFrameProxy::frameFocused() { 499 void RenderFrameProxy::frameFocused() {
500 Send(new FrameHostMsg_FrameFocused(routing_id_)); 500 Send(new FrameHostMsg_FrameFocused(routing_id_));
501 } 501 }
502 502
503 void RenderFrameProxy::forwardContentSecurityPolicyViolation(
504 const blink::WebString& directive_text,
505 const blink::WebString& effective_directive,
506 const blink::WebString& console_message,
507 const blink::WebURL& blocked_url,
508 const blink::WebVector<blink::WebString>& report_endpoints,
509 const blink::WebString& header,
510 blink::WebContentSecurityPolicyViolationType violation_type,
511 bool followed_redirect,
512 int context_line) {
513 content::ContentSecurityPolicyViolation violation;
514 violation.directive_text = directive_text.utf8();
515 violation.effective_directive = effective_directive.utf8();
516 violation.console_message = console_message.utf8();
517 violation.blocked_url = blocked_url;
518
519 violation.report_endpoints.reserve(report_endpoints.size());
520 for (const blink::WebString& report_endpoint : report_endpoints)
521 violation.report_endpoints.push_back(report_endpoint.utf8());
522
523 violation.header = header.utf8();
524 violation.violation_type = violation_type;
525 violation.followed_redirect = followed_redirect;
526 violation.context_line = context_line;
527
528 Send(new FrameHostMsg_ForwardContentSecurityPolicyViolation(routing_id_,
529 violation));
530 }
531
503 } // namespace 532 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698