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

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: Rebase. Created 3 years, 10 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 frame_entry, request_body, dest_url, dest_referrer, navigation_type, 211 frame_entry, request_body, dest_url, dest_referrer, navigation_type,
212 previews_state, navigation_start); 212 previews_state, navigation_start);
213 213
214 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest( 214 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
215 frame_tree_node, common_params, 215 frame_tree_node, common_params,
216 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL, 216 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
217 false, // has_user_gestures 217 false, // has_user_gestures
218 false, // skip_service_worker 218 false, // skip_service_worker
219 REQUEST_CONTEXT_TYPE_LOCATION, 219 REQUEST_CONTEXT_TYPE_LOCATION,
220 blink::WebMixedContentContextType::Blockable, 220 blink::WebMixedContentContextType::Blockable,
221 false, // is_form_submission
221 initiator), 222 initiator),
222 entry.ConstructRequestNavigationParams( 223 entry.ConstructRequestNavigationParams(
223 frame_entry, common_params.url, common_params.method, 224 frame_entry, common_params.url, common_params.method,
224 is_history_navigation_in_new_child, 225 is_history_navigation_in_new_child,
225 entry.GetSubframeUniqueNames(frame_tree_node), 226 entry.GetSubframeUniqueNames(frame_tree_node),
226 frame_tree_node->has_committed_real_load(), 227 frame_tree_node->has_committed_real_load(),
227 controller->GetPendingEntryIndex() == -1, 228 controller->GetPendingEntryIndex() == -1,
228 controller->GetIndexOfEntry(&entry), 229 controller->GetIndexOfEntry(&entry),
229 controller->GetLastCommittedEntryIndex(), 230 controller->GetLastCommittedEntryIndex(),
230 controller->GetEntryCount()), 231 controller->GetEntryCount()),
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 redirect_chain.push_back(common_params_.url); 390 redirect_chain.push_back(common_params_.url);
390 391
391 std::unique_ptr<NavigationHandleImpl> navigation_handle = 392 std::unique_ptr<NavigationHandleImpl> navigation_handle =
392 NavigationHandleImpl::Create(common_params_.url, redirect_chain, 393 NavigationHandleImpl::Create(common_params_.url, redirect_chain,
393 frame_tree_node_, !browser_initiated_, 394 frame_tree_node_, !browser_initiated_,
394 FrameMsg_Navigate_Type::IsSameDocument( 395 FrameMsg_Navigate_Type::IsSameDocument(
395 common_params_.navigation_type), 396 common_params_.navigation_type),
396 common_params_.navigation_start, 397 common_params_.navigation_start,
397 pending_nav_entry_id, 398 pending_nav_entry_id,
398 false, // started_in_context_menu 399 false, // started_in_context_menu
399 common_params_.should_bypass_main_world_csp); 400 common_params_.should_bypass_main_world_csp,
401 begin_params_.is_form_submission);
400 402
401 if (!frame_tree_node->navigation_request()) { 403 if (!frame_tree_node->navigation_request()) {
402 // A callback could have cancelled this request synchronously in which case 404 // A callback could have cancelled this request synchronously in which case
403 // |this| is deleted. 405 // |this| is deleted.
404 return; 406 return;
405 } 407 }
406 408
407 navigation_handle_ = std::move(navigation_handle); 409 navigation_handle_ = std::move(navigation_handle);
408 410
409 if (!begin_params_.searchable_form_url.is_empty()) { 411 if (!begin_params_.searchable_form_url.is_empty()) {
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 774 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
773 775
774 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 776 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
775 common_params_, request_params_, 777 common_params_, request_params_,
776 is_view_source_); 778 is_view_source_);
777 779
778 frame_tree_node_->ResetNavigationRequest(true); 780 frame_tree_node_->ResetNavigationRequest(true);
779 } 781 }
780 782
781 } // namespace content 783 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698