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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 } | 394 } |
395 | 395 |
396 if (navigation_data) | 396 if (navigation_data) |
397 navigation_handle_->set_navigation_data(std::move(navigation_data)); | 397 navigation_handle_->set_navigation_data(std::move(navigation_data)); |
398 | 398 |
399 // Store the response and the StreamHandle until checks have been processed. | 399 // Store the response and the StreamHandle until checks have been processed. |
400 response_ = response; | 400 response_ = response; |
401 body_ = std::move(body); | 401 body_ = std::move(body); |
402 | 402 |
403 // Check if the navigation should be allowed to proceed. | 403 // Check if the navigation should be allowed to proceed. |
| 404 // TODO(clamy): pass the right values for request_id, is_download and |
| 405 // is_stream. |
404 navigation_handle_->WillProcessResponse( | 406 navigation_handle_->WillProcessResponse( |
405 render_frame_host, response->head.headers.get(), ssl_status, | 407 render_frame_host, response->head.headers.get(), ssl_status, |
| 408 GlobalRequestID(), common_params_.should_replace_current_entry, false, |
| 409 false, base::Closure(), |
406 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, | 410 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
407 base::Unretained(this))); | 411 base::Unretained(this))); |
408 } | 412 } |
409 | 413 |
410 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, | 414 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
411 int net_error) { | 415 int net_error) { |
412 DCHECK(state_ == STARTED); | 416 DCHECK(state_ == STARTED); |
413 state_ = FAILED; | 417 state_ = FAILED; |
414 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); | 418 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); |
415 frame_tree_node_->navigator()->FailedNavigation( | 419 frame_tree_node_->navigator()->FailedNavigation( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 546 |
543 TransferNavigationHandleOwnership(render_frame_host); | 547 TransferNavigationHandleOwnership(render_frame_host); |
544 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 548 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
545 common_params_, request_params_, | 549 common_params_, request_params_, |
546 is_view_source_); | 550 is_view_source_); |
547 | 551 |
548 frame_tree_node_->ResetNavigationRequest(true); | 552 frame_tree_node_->ResetNavigationRequest(true); |
549 } | 553 } |
550 | 554 |
551 } // namespace content | 555 } // namespace content |
OLD | NEW |