Chromium Code Reviews| Index: content/browser/frame_host/navigation_request.cc |
| diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc |
| index d03296caa40bf39dae9625a1f2f76ed183dcccf3..d63418bb2e960a986627d79e82a85cb945077744 100644 |
| --- a/content/browser/frame_host/navigation_request.cc |
| +++ b/content/browser/frame_host/navigation_request.cc |
| @@ -14,20 +14,21 @@ |
| #include "content/browser/frame_host/navigation_request_info.h" |
| #include "content/browser/frame_host/navigator.h" |
| #include "content/browser/frame_host/navigator_impl.h" |
| #include "content/browser/loader/navigation_url_loader.h" |
| #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| #include "content/browser/site_instance_impl.h" |
| #include "content/common/resource_request_body.h" |
| #include "content/public/browser/browser_context.h" |
| #include "content/public/browser/navigation_controller.h" |
| +#include "content/public/browser/navigation_data.h" |
| #include "content/public/browser/storage_partition.h" |
| #include "content/public/browser/stream_handle.h" |
| #include "content/public/common/content_client.h" |
| #include "content/public/common/resource_response.h" |
| #include "net/base/load_flags.h" |
| #include "net/http/http_request_headers.h" |
| #include "net/url_request/redirect_info.h" |
| #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| namespace content { |
| @@ -267,21 +268,22 @@ void NavigationRequest::OnRequestRedirected( |
| // TODO(clamy): pass the real value for |is_external_protocol| if needed. |
| navigation_handle_->WillRedirectRequest( |
| common_params_.url, common_params_.method == "POST", |
| common_params_.referrer.url, false, response->head.headers, |
| base::Bind(&NavigationRequest::OnRedirectChecksComplete, |
| base::Unretained(this))); |
| } |
| void NavigationRequest::OnResponseStarted( |
| const scoped_refptr<ResourceResponse>& response, |
| - std::unique_ptr<StreamHandle> body) { |
| + std::unique_ptr<StreamHandle> body, |
| + std::unique_ptr<NavigationData> navigation_data) { |
| DCHECK(state_ == STARTED); |
| state_ = RESPONSE_STARTED; |
| // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| // commit; they leave the frame showing the previous page. |
| DCHECK(response); |
| if (response->head.headers.get() && |
| (response->head.headers->response_code() == 204 || |
| response->head.headers->response_code() == 205)) { |
| frame_tree_node_->ResetNavigationRequest(false); |
| @@ -314,20 +316,24 @@ void NavigationRequest::OnResponseStarted( |
| // renderer, allow the embedder to cancel the transfer. |
| if (!browser_initiated_ && |
| render_frame_host != frame_tree_node_->current_frame_host() && |
| !frame_tree_node_->navigator() |
| ->GetDelegate() |
| ->ShouldTransferNavigation()) { |
| frame_tree_node_->ResetNavigationRequest(false); |
| return; |
| } |
| + if (navigation_data.get()) { |
|
nasko
2016/04/26 20:18:39
nit: No need for {} on one line if statements.
RyanSturm
2016/04/27 23:27:47
Done.
|
| + navigation_handle_->SetNavigationData(std::move(navigation_data)); |
| + } |
| + |
| // Store the response and the StreamHandle until checks have been processed. |
| response_ = response; |
| body_ = std::move(body); |
| // Check if the navigation should be allowed to proceed. |
| navigation_handle_->WillProcessResponse( |
| render_frame_host, response->head.headers.get(), |
| base::Bind(&NavigationRequest::OnWillProcessResponseChecksComplete, |
| base::Unretained(this))); |
| } |