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

Side by Side Diff: content/browser/frame_host/form_submission_throttle.cc

Issue 2761153003: PlzNavigate & CSP. Use the SourceLocation in violation reports. (Closed)
Patch Set: Addressed comment @alexmos Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/browser/frame_host/form_submission_throttle.h" 5 #include "content/browser/frame_host/form_submission_throttle.h"
6 #include "content/browser/frame_host/navigation_handle_impl.h" 6 #include "content/browser/frame_host/navigation_handle_impl.h"
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/navigation_handle.h" 8 #include "content/public/browser/navigation_handle.h"
9 #include "content/public/browser/navigation_throttle.h" 9 #include "content/public/browser/navigation_throttle.h"
10 #include "content/public/common/browser_side_navigation_policy.h" 10 #include "content/public/common/browser_side_navigation_policy.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 NavigationHandleImpl* handle = 49 NavigationHandleImpl* handle =
50 static_cast<NavigationHandleImpl*>(navigation_handle()); 50 static_cast<NavigationHandleImpl*>(navigation_handle());
51 51
52 if (handle->should_check_main_world_csp() == CSPDisposition::DO_NOT_CHECK) 52 if (handle->should_check_main_world_csp() == CSPDisposition::DO_NOT_CHECK)
53 return NavigationThrottle::PROCEED; 53 return NavigationThrottle::PROCEED;
54 54
55 const GURL& url = handle->GetURL(); 55 const GURL& url = handle->GetURL();
56 RenderFrameHostImpl* render_frame = 56 RenderFrameHostImpl* render_frame =
57 handle->frame_tree_node()->current_frame_host(); 57 handle->frame_tree_node()->current_frame_host();
58 58
59 if (render_frame->IsAllowedByCsp(CSPDirective::FormAction, url, is_redirect)) 59 if (render_frame->IsAllowedByCsp(CSPDirective::FormAction, url, is_redirect,
60 handle->source_location())) {
60 return NavigationThrottle::PROCEED; 61 return NavigationThrottle::PROCEED;
62 }
61 63
62 return NavigationThrottle::CANCEL; 64 return NavigationThrottle::CANCEL;
63 } 65 }
64 66
65 } // namespace content 67 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/ancestor_throttle.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698