| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 | 370 |
| 371 if (navigation_data) | 371 if (navigation_data) |
| 372 navigation_handle_->set_navigation_data(std::move(navigation_data)); | 372 navigation_handle_->set_navigation_data(std::move(navigation_data)); |
| 373 | 373 |
| 374 // Store the response and the StreamHandle until checks have been processed. | 374 // Store the response and the StreamHandle until checks have been processed. |
| 375 response_ = response; | 375 response_ = response; |
| 376 body_ = std::move(body); | 376 body_ = std::move(body); |
| 377 | 377 |
| 378 // Check if the navigation should be allowed to proceed. | 378 // Check if the navigation should be allowed to proceed. |
| 379 // TODO(clamy): pass the right values for request_id, is_download and |
| 380 // is_stream. |
| 379 navigation_handle_->WillProcessResponse( | 381 navigation_handle_->WillProcessResponse( |
| 380 render_frame_host, response->head.headers.get(), ssl_status, | 382 render_frame_host, response->head.headers.get(), ssl_status, |
| 383 GlobalRequestID(), common_params_.should_replace_current_entry, false, |
| 384 false, base::Closure(), |
| 381 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, | 385 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
| 382 base::Unretained(this))); | 386 base::Unretained(this))); |
| 383 } | 387 } |
| 384 | 388 |
| 385 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, | 389 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
| 386 int net_error) { | 390 int net_error) { |
| 387 DCHECK(state_ == STARTED); | 391 DCHECK(state_ == STARTED); |
| 388 state_ = FAILED; | 392 state_ = FAILED; |
| 389 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); | 393 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); |
| 390 frame_tree_node_->navigator()->FailedNavigation( | 394 frame_tree_node_->navigator()->FailedNavigation( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 521 |
| 518 TransferNavigationHandleOwnership(render_frame_host); | 522 TransferNavigationHandleOwnership(render_frame_host); |
| 519 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 523 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 520 common_params_, request_params_, | 524 common_params_, request_params_, |
| 521 is_view_source_); | 525 is_view_source_); |
| 522 | 526 |
| 523 frame_tree_node_->ResetNavigationRequest(true); | 527 frame_tree_node_->ResetNavigationRequest(true); |
| 524 } | 528 } |
| 525 | 529 |
| 526 } // namespace content | 530 } // namespace content |
| OLD | NEW |