| 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 3ed4510f56f7d6f6c77d83fa6cda73449e46727f..c9d562d2f72dab55de5675cc9665a9e82afc11a7 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, 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,23 @@ 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)
|
| + navigation_handle_->set_navigation_data(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)));
|
| }
|
|
|