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

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

Issue 2756913002: Revert of PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/navigation_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // static 58 // static
59 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( 59 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
60 const GURL& url, 60 const GURL& url,
61 const std::vector<GURL>& redirect_chain, 61 const std::vector<GURL>& redirect_chain,
62 FrameTreeNode* frame_tree_node, 62 FrameTreeNode* frame_tree_node,
63 bool is_renderer_initiated, 63 bool is_renderer_initiated,
64 bool is_same_page, 64 bool is_same_page,
65 const base::TimeTicks& navigation_start, 65 const base::TimeTicks& navigation_start,
66 int pending_nav_entry_id, 66 int pending_nav_entry_id,
67 bool started_from_context_menu, 67 bool started_from_context_menu) {
68 CSPDisposition should_check_main_world_csp) {
69 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( 68 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl(
70 url, redirect_chain, frame_tree_node, is_renderer_initiated, is_same_page, 69 url, redirect_chain, frame_tree_node, is_renderer_initiated, is_same_page,
71 navigation_start, pending_nav_entry_id, started_from_context_menu, 70 navigation_start, pending_nav_entry_id,
72 should_check_main_world_csp)); 71 started_from_context_menu));
73 } 72 }
74 73
75 NavigationHandleImpl::NavigationHandleImpl( 74 NavigationHandleImpl::NavigationHandleImpl(
76 const GURL& url, 75 const GURL& url,
77 const std::vector<GURL>& redirect_chain, 76 const std::vector<GURL>& redirect_chain,
78 FrameTreeNode* frame_tree_node, 77 FrameTreeNode* frame_tree_node,
79 bool is_renderer_initiated, 78 bool is_renderer_initiated,
80 bool is_same_page, 79 bool is_same_page,
81 const base::TimeTicks& navigation_start, 80 const base::TimeTicks& navigation_start,
82 int pending_nav_entry_id, 81 int pending_nav_entry_id,
83 bool started_from_context_menu, 82 bool started_from_context_menu)
84 CSPDisposition should_check_main_world_csp)
85 : url_(url), 83 : url_(url),
86 has_user_gesture_(false), 84 has_user_gesture_(false),
87 transition_(ui::PAGE_TRANSITION_LINK), 85 transition_(ui::PAGE_TRANSITION_LINK),
88 is_external_protocol_(false), 86 is_external_protocol_(false),
89 net_error_code_(net::OK), 87 net_error_code_(net::OK),
90 render_frame_host_(nullptr), 88 render_frame_host_(nullptr),
91 is_renderer_initiated_(is_renderer_initiated), 89 is_renderer_initiated_(is_renderer_initiated),
92 is_same_page_(is_same_page), 90 is_same_page_(is_same_page),
93 was_redirected_(false), 91 was_redirected_(false),
94 did_replace_entry_(false), 92 did_replace_entry_(false),
(...skipping 10 matching lines...) Expand all
105 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), 103 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED),
106 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable), 104 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable),
107 should_replace_current_entry_(false), 105 should_replace_current_entry_(false),
108 redirect_chain_(redirect_chain), 106 redirect_chain_(redirect_chain),
109 is_download_(false), 107 is_download_(false),
110 is_stream_(false), 108 is_stream_(false),
111 started_from_context_menu_(started_from_context_menu), 109 started_from_context_menu_(started_from_context_menu),
112 reload_type_(ReloadType::NONE), 110 reload_type_(ReloadType::NONE),
113 restore_type_(RestoreType::NONE), 111 restore_type_(RestoreType::NONE),
114 navigation_type_(NAVIGATION_TYPE_UNKNOWN), 112 navigation_type_(NAVIGATION_TYPE_UNKNOWN),
115 should_check_main_world_csp_(should_check_main_world_csp),
116 weak_factory_(this) { 113 weak_factory_(this) {
117 DCHECK(!navigation_start.is_null()); 114 DCHECK(!navigation_start.is_null());
118 if (redirect_chain_.empty()) 115 if (redirect_chain_.empty())
119 redirect_chain_.push_back(url); 116 redirect_chain_.push_back(url);
120 117
121 starting_site_instance_ = 118 starting_site_instance_ =
122 frame_tree_node_->current_frame_host()->GetSiteInstance(); 119 frame_tree_node_->current_frame_host()->GetSiteInstance();
123 120
124 if (pending_nav_entry_id_) { 121 if (pending_nav_entry_id_) {
125 NavigationControllerImpl* nav_controller = 122 NavigationControllerImpl* nav_controller =
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 if (node->current_url().EqualsIgnoringRef(url_)) { 966 if (node->current_url().EqualsIgnoringRef(url_)) {
970 if (found_self_reference) 967 if (found_self_reference)
971 return true; 968 return true;
972 found_self_reference = true; 969 found_self_reference = true;
973 } 970 }
974 } 971 }
975 return false; 972 return false;
976 } 973 }
977 974
978 } // namespace content 975 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/frame_host/navigation_handle_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698