| 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 "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 common_params_.url, common_params_.method, common_params_.referrer.url, | 501 common_params_.url, common_params_.method, common_params_.referrer.url, |
| 502 is_external_protocol, response->head.headers, | 502 is_external_protocol, response->head.headers, |
| 503 response->head.connection_info, | 503 response->head.connection_info, |
| 504 base::Bind(&NavigationRequest::OnRedirectChecksComplete, | 504 base::Bind(&NavigationRequest::OnRedirectChecksComplete, |
| 505 base::Unretained(this))); | 505 base::Unretained(this))); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void NavigationRequest::OnResponseStarted( | 508 void NavigationRequest::OnResponseStarted( |
| 509 const scoped_refptr<ResourceResponse>& response, | 509 const scoped_refptr<ResourceResponse>& response, |
| 510 std::unique_ptr<StreamHandle> body, | 510 std::unique_ptr<StreamHandle> body, |
| 511 mojo::ScopedDataPipeConsumerHandle consumer_handle, |
| 511 const SSLStatus& ssl_status, | 512 const SSLStatus& ssl_status, |
| 512 std::unique_ptr<NavigationData> navigation_data, | 513 std::unique_ptr<NavigationData> navigation_data, |
| 513 const GlobalRequestID& request_id, | 514 const GlobalRequestID& request_id, |
| 514 bool is_download, | 515 bool is_download, |
| 515 bool is_stream) { | 516 bool is_stream) { |
| 516 DCHECK(state_ == STARTED); | 517 DCHECK(state_ == STARTED); |
| 517 DCHECK(response); | 518 DCHECK(response); |
| 518 state_ = RESPONSE_STARTED; | 519 state_ = RESPONSE_STARTED; |
| 519 | 520 |
| 520 // Check if the response should be sent to a renderer. | 521 // Check if the response should be sent to a renderer. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 return; | 574 return; |
| 574 } | 575 } |
| 575 } | 576 } |
| 576 | 577 |
| 577 if (navigation_data) | 578 if (navigation_data) |
| 578 navigation_handle_->set_navigation_data(std::move(navigation_data)); | 579 navigation_handle_->set_navigation_data(std::move(navigation_data)); |
| 579 | 580 |
| 580 // Store the response and the StreamHandle until checks have been processed. | 581 // Store the response and the StreamHandle until checks have been processed. |
| 581 response_ = response; | 582 response_ = response; |
| 582 body_ = std::move(body); | 583 body_ = std::move(body); |
| 584 handle_ = std::move(consumer_handle); |
| 583 | 585 |
| 584 // Check if the navigation should be allowed to proceed. | 586 // Check if the navigation should be allowed to proceed. |
| 585 navigation_handle_->WillProcessResponse( | 587 navigation_handle_->WillProcessResponse( |
| 586 render_frame_host, response->head.headers.get(), | 588 render_frame_host, response->head.headers.get(), |
| 587 response->head.connection_info, ssl_status, request_id, | 589 response->head.connection_info, ssl_status, request_id, |
| 588 common_params_.should_replace_current_entry, is_download, is_stream, | 590 common_params_.should_replace_current_entry, is_download, is_stream, |
| 589 base::Closure(), | 591 base::Closure(), |
| 590 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, | 592 base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
| 591 base::Unretained(this))); | 593 base::Unretained(this))); |
| 592 } | 594 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 DCHECK(render_frame_host == | 835 DCHECK(render_frame_host == |
| 834 frame_tree_node_->render_manager()->current_frame_host() || | 836 frame_tree_node_->render_manager()->current_frame_host() || |
| 835 render_frame_host == | 837 render_frame_host == |
| 836 frame_tree_node_->render_manager()->speculative_frame_host()); | 838 frame_tree_node_->render_manager()->speculative_frame_host()); |
| 837 | 839 |
| 838 TransferNavigationHandleOwnership(render_frame_host); | 840 TransferNavigationHandleOwnership(render_frame_host); |
| 839 | 841 |
| 840 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 842 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
| 841 | 843 |
| 842 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 844 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 843 common_params_, request_params_, | 845 std::move(handle_), common_params_, |
| 844 is_view_source_); | 846 request_params_, is_view_source_); |
| 845 | 847 |
| 846 frame_tree_node_->ResetNavigationRequest(true, true); | 848 frame_tree_node_->ResetNavigationRequest(true, true); |
| 847 } | 849 } |
| 848 | 850 |
| 849 } // namespace content | 851 } // namespace content |
| OLD | NEW |