| OLD | NEW |
| 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 "content/browser/devtools/render_frame_devtools_agent_host.h" | 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 | 400 |
| 401 if (navigation_data) | 401 if (navigation_data) |
| 402 navigation_handle_->set_navigation_data(std::move(navigation_data)); | 402 navigation_handle_->set_navigation_data(std::move(navigation_data)); |
| 403 | 403 |
| 404 // Store the response and the StreamHandle until checks have been processed. | 404 // Store the response and the StreamHandle until checks have been processed. |
| 405 response_ = response; | 405 response_ = response; |
| 406 body_ = std::move(body); | 406 body_ = std::move(body); |
| 407 | 407 |
| 408 // Check if the navigation should be allowed to proceed. | 408 // Check if the navigation should be allowed to proceed. |
| 409 // TODO(clamy): pass the right values for request_id, is_download and | |
| 410 // is_stream. | |
| 411 navigation_handle_->WillProcessResponse( | 409 navigation_handle_->WillProcessResponse( |
| 412 render_frame_host, response->head.headers.get(), ssl_status, | 410 render_frame_host, response->head.headers.get(), ssl_status, |
| 413 GlobalRequestID(), common_params_.should_replace_current_entry, false, | |
| 414 false, base::Closure(), | |
| 415 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, | 411 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
| 416 base::Unretained(this))); | 412 base::Unretained(this))); |
| 417 } | 413 } |
| 418 | 414 |
| 419 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, | 415 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
| 420 int net_error) { | 416 int net_error) { |
| 421 DCHECK(state_ == STARTED); | 417 DCHECK(state_ == STARTED); |
| 422 state_ = FAILED; | 418 state_ = FAILED; |
| 423 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); | 419 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); |
| 424 frame_tree_node_->navigator()->FailedNavigation( | 420 frame_tree_node_->navigator()->FailedNavigation( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 555 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
| 560 | 556 |
| 561 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 557 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 562 common_params_, request_params_, | 558 common_params_, request_params_, |
| 563 is_view_source_); | 559 is_view_source_); |
| 564 | 560 |
| 565 frame_tree_node_->ResetNavigationRequest(true); | 561 frame_tree_node_->ResetNavigationRequest(true); |
| 566 } | 562 } |
| 567 | 563 |
| 568 } // namespace content | 564 } // namespace content |
| OLD | NEW |