| OLD | NEW |
| 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/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 scoped_refptr<content::ResourceRequestBody> resource_request_body, | 563 scoped_refptr<content::ResourceRequestBody> resource_request_body, |
| 564 const Referrer& sanitized_referrer, | 564 const Referrer& sanitized_referrer, |
| 565 bool has_user_gesture, | 565 bool has_user_gesture, |
| 566 ui::PageTransition transition, | 566 ui::PageTransition transition, |
| 567 bool is_external_protocol, | 567 bool is_external_protocol, |
| 568 RequestContextType request_context_type, | 568 RequestContextType request_context_type, |
| 569 blink::WebMixedContentContextType mixed_content_context_type, | 569 blink::WebMixedContentContextType mixed_content_context_type, |
| 570 const ThrottleChecksFinishedCallback& callback) { | 570 const ThrottleChecksFinishedCallback& callback) { |
| 571 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, | 571 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, |
| 572 "WillStartRequest"); | 572 "WillStartRequest"); |
| 573 // WillStartRequest should only be called once. |
| 574 if (state_ != INITIAL) { |
| 575 state_ = CANCELING; |
| 576 RunCompleteCallback(NavigationThrottle::CANCEL); |
| 577 return; |
| 578 } |
| 579 |
| 573 if (method != "POST") | 580 if (method != "POST") |
| 574 DCHECK(!resource_request_body); | 581 DCHECK(!resource_request_body); |
| 575 | 582 |
| 576 // Update the navigation parameters. | 583 // Update the navigation parameters. |
| 577 method_ = method; | 584 method_ = method; |
| 578 if (method_ == "POST") | 585 if (method_ == "POST") |
| 579 resource_request_body_ = resource_request_body; | 586 resource_request_body_ = resource_request_body; |
| 580 has_user_gesture_ = has_user_gesture; | 587 has_user_gesture_ = has_user_gesture; |
| 581 transition_ = transition; | 588 transition_ = transition; |
| 582 // Mirrors the logic in RenderFrameImpl::SendDidCommitProvisionalLoad. | 589 // Mirrors the logic in RenderFrameImpl::SendDidCommitProvisionalLoad. |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 // Stop expecting a navigation to the current site URL in the current expected | 1191 // Stop expecting a navigation to the current site URL in the current expected |
| 1185 // process. | 1192 // process. |
| 1186 SetExpectedProcess(nullptr); | 1193 SetExpectedProcess(nullptr); |
| 1187 | 1194 |
| 1188 // Update the site URL and the expected process. | 1195 // Update the site URL and the expected process. |
| 1189 site_url_ = new_site_url; | 1196 site_url_ = new_site_url; |
| 1190 SetExpectedProcess(post_redirect_process); | 1197 SetExpectedProcess(post_redirect_process); |
| 1191 } | 1198 } |
| 1192 | 1199 |
| 1193 } // namespace content | 1200 } // namespace content |
| OLD | NEW |