Chromium Code Reviews| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 } | 329 } |
| 330 | 330 |
| 331 if (navigation_data) | 331 if (navigation_data) |
| 332 navigation_handle_->set_navigation_data(std::move(navigation_data)); | 332 navigation_handle_->set_navigation_data(std::move(navigation_data)); |
| 333 | 333 |
| 334 // Store the response and the StreamHandle until checks have been processed. | 334 // Store the response and the StreamHandle until checks have been processed. |
| 335 response_ = response; | 335 response_ = response; |
| 336 body_ = std::move(body); | 336 body_ = std::move(body); |
| 337 | 337 |
| 338 // Check if the navigation should be allowed to proceed. | 338 // Check if the navigation should be allowed to proceed. |
| 339 // TODO(clamy): pass the right values for request_id, is_download and | |
| 340 // is_stream. | |
|
nasko
2016/09/08 23:45:39
Do you plan to resolve this TODO before committing
clamy
2016/09/09 15:06:41
No I plan to do it in a separate one. Since this i
| |
| 339 navigation_handle_->WillProcessResponse( | 341 navigation_handle_->WillProcessResponse( |
| 340 render_frame_host, response->head.headers.get(), ssl_status, | 342 render_frame_host, response->head.headers.get(), ssl_status, |
| 343 GlobalRequestID(), common_params_.should_replace_current_entry, false, | |
| 344 false, base::Closure(), | |
| 341 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, | 345 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
| 342 base::Unretained(this))); | 346 base::Unretained(this))); |
| 343 } | 347 } |
| 344 | 348 |
| 345 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, | 349 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
| 346 int net_error) { | 350 int net_error) { |
| 347 DCHECK(state_ == STARTED); | 351 DCHECK(state_ == STARTED); |
| 348 state_ = FAILED; | 352 state_ = FAILED; |
| 349 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); | 353 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); |
| 350 frame_tree_node_->navigator()->FailedNavigation( | 354 frame_tree_node_->navigator()->FailedNavigation( |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 | 464 |
| 461 TransferNavigationHandleOwnership(render_frame_host); | 465 TransferNavigationHandleOwnership(render_frame_host); |
| 462 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 466 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 463 common_params_, request_params_, | 467 common_params_, request_params_, |
| 464 is_view_source_); | 468 is_view_source_); |
| 465 | 469 |
| 466 frame_tree_node_->ResetNavigationRequest(true); | 470 frame_tree_node_->ResetNavigationRequest(true); |
| 467 } | 471 } |
| 468 | 472 |
| 469 } // namespace content | 473 } // namespace content |
| OLD | NEW |