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

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, 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 frame_entry, request_body, dest_url, dest_referrer, navigation_type, 217 frame_entry, request_body, dest_url, dest_referrer, navigation_type,
218 previews_state, navigation_start); 218 previews_state, navigation_start);
219 219
220 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest( 220 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
221 frame_tree_node, common_params, 221 frame_tree_node, common_params,
222 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL, 222 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
223 false, // has_user_gestures 223 false, // has_user_gestures
224 false, // skip_service_worker 224 false, // skip_service_worker
225 REQUEST_CONTEXT_TYPE_LOCATION, 225 REQUEST_CONTEXT_TYPE_LOCATION,
226 blink::WebMixedContentContextType::Blockable, 226 blink::WebMixedContentContextType::Blockable,
227 // TODO(arthursonzogni): It can be true for form
228 // resubmission when the user reloads the page. This
229 // needs to be fixed.
230 false, // is_form_submission
227 initiator), 231 initiator),
228 entry.ConstructRequestNavigationParams( 232 entry.ConstructRequestNavigationParams(
229 frame_entry, common_params.url, common_params.method, 233 frame_entry, common_params.url, common_params.method,
230 is_history_navigation_in_new_child, 234 is_history_navigation_in_new_child,
231 entry.GetSubframeUniqueNames(frame_tree_node), 235 entry.GetSubframeUniqueNames(frame_tree_node),
232 frame_tree_node->has_committed_real_load(), 236 frame_tree_node->has_committed_real_load(),
233 controller->GetPendingEntryIndex() == -1, 237 controller->GetPendingEntryIndex() == -1,
234 controller->GetIndexOfEntry(&entry), 238 controller->GetIndexOfEntry(&entry),
235 controller->GetLastCommittedEntryIndex(), 239 controller->GetLastCommittedEntryIndex(),
236 controller->GetEntryCount()), 240 controller->GetEntryCount()),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 redirect_chain.push_back(common_params_.url); 401 redirect_chain.push_back(common_params_.url);
398 402
399 std::unique_ptr<NavigationHandleImpl> navigation_handle = 403 std::unique_ptr<NavigationHandleImpl> navigation_handle =
400 NavigationHandleImpl::Create(common_params_.url, redirect_chain, 404 NavigationHandleImpl::Create(common_params_.url, redirect_chain,
401 frame_tree_node_, !browser_initiated_, 405 frame_tree_node_, !browser_initiated_,
402 FrameMsg_Navigate_Type::IsSameDocument( 406 FrameMsg_Navigate_Type::IsSameDocument(
403 common_params_.navigation_type), 407 common_params_.navigation_type),
404 common_params_.navigation_start, 408 common_params_.navigation_start,
405 pending_nav_entry_id, 409 pending_nav_entry_id,
406 false, // started_in_context_menu 410 false, // started_in_context_menu
407 common_params_.should_check_main_world_csp); 411 common_params_.should_check_main_world_csp,
412 begin_params_.is_form_submission);
408 413
409 if (!frame_tree_node->navigation_request()) { 414 if (!frame_tree_node->navigation_request()) {
410 // A callback could have cancelled this request synchronously in which case 415 // A callback could have cancelled this request synchronously in which case
411 // |this| is deleted. 416 // |this| is deleted.
412 return; 417 return;
413 } 418 }
414 419
415 navigation_handle_ = std::move(navigation_handle); 420 navigation_handle_ = std::move(navigation_handle);
416 421
417 if (!begin_params_.searchable_form_url.is_empty()) { 422 if (!begin_params_.searchable_form_url.is_empty()) {
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 818 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
814 819
815 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 820 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
816 common_params_, request_params_, 821 common_params_, request_params_,
817 is_view_source_); 822 is_view_source_);
818 823
819 frame_tree_node_->ResetNavigationRequest(true); 824 frame_tree_node_->ResetNavigationRequest(true);
820 } 825 }
821 826
822 } // namespace content 827 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl_unittest.cc ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698