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

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

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Add TODO. 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 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/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 frame_entry, request_body, dest_url, dest_referrer, navigation_type, 214 frame_entry, request_body, dest_url, dest_referrer, navigation_type,
215 previews_state, navigation_start); 215 previews_state, navigation_start);
216 216
217 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest( 217 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
218 frame_tree_node, common_params, 218 frame_tree_node, common_params,
219 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL, 219 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
220 false, // has_user_gestures 220 false, // has_user_gestures
221 false, // skip_service_worker 221 false, // skip_service_worker
222 REQUEST_CONTEXT_TYPE_LOCATION, 222 REQUEST_CONTEXT_TYPE_LOCATION,
223 blink::WebMixedContentContextType::Blockable, 223 blink::WebMixedContentContextType::Blockable,
224 false, // is_form_submission
nasko 2017/03/16 21:49:47 I know the browser pops up a dialog warning you if
arthursonzogni 2017/03/17 14:58:25 You are right. The current behavior is to check t
224 initiator), 225 initiator),
225 entry.ConstructRequestNavigationParams( 226 entry.ConstructRequestNavigationParams(
226 frame_entry, common_params.url, common_params.method, 227 frame_entry, common_params.url, common_params.method,
227 is_history_navigation_in_new_child, 228 is_history_navigation_in_new_child,
228 entry.GetSubframeUniqueNames(frame_tree_node), 229 entry.GetSubframeUniqueNames(frame_tree_node),
229 frame_tree_node->has_committed_real_load(), 230 frame_tree_node->has_committed_real_load(),
230 controller->GetPendingEntryIndex() == -1, 231 controller->GetPendingEntryIndex() == -1,
231 controller->GetIndexOfEntry(&entry), 232 controller->GetIndexOfEntry(&entry),
232 controller->GetLastCommittedEntryIndex(), 233 controller->GetLastCommittedEntryIndex(),
233 controller->GetEntryCount()), 234 controller->GetEntryCount()),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 redirect_chain.push_back(common_params_.url); 395 redirect_chain.push_back(common_params_.url);
395 396
396 std::unique_ptr<NavigationHandleImpl> navigation_handle = 397 std::unique_ptr<NavigationHandleImpl> navigation_handle =
397 NavigationHandleImpl::Create(common_params_.url, redirect_chain, 398 NavigationHandleImpl::Create(common_params_.url, redirect_chain,
398 frame_tree_node_, !browser_initiated_, 399 frame_tree_node_, !browser_initiated_,
399 FrameMsg_Navigate_Type::IsSameDocument( 400 FrameMsg_Navigate_Type::IsSameDocument(
400 common_params_.navigation_type), 401 common_params_.navigation_type),
401 common_params_.navigation_start, 402 common_params_.navigation_start,
402 pending_nav_entry_id, 403 pending_nav_entry_id,
403 false, // started_in_context_menu 404 false, // started_in_context_menu
404 common_params_.should_bypass_main_world_csp); 405 common_params_.should_bypass_main_world_csp,
406 begin_params_.is_form_submission);
405 407
406 if (!frame_tree_node->navigation_request()) { 408 if (!frame_tree_node->navigation_request()) {
407 // A callback could have cancelled this request synchronously in which case 409 // A callback could have cancelled this request synchronously in which case
408 // |this| is deleted. 410 // |this| is deleted.
409 return; 411 return;
410 } 412 }
411 413
412 navigation_handle_ = std::move(navigation_handle); 414 navigation_handle_ = std::move(navigation_handle);
413 415
414 if (!begin_params_.searchable_form_url.is_empty()) { 416 if (!begin_params_.searchable_form_url.is_empty()) {
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 785 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
784 786
785 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 787 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
786 common_params_, request_params_, 788 common_params_, request_params_,
787 is_view_source_); 789 is_view_source_);
788 790
789 frame_tree_node_->ResetNavigationRequest(true); 791 frame_tree_node_->ResetNavigationRequest(true);
790 } 792 }
791 793
792 } // namespace content 794 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698