Commit 81779cde authored by Dominic Farolino's avatar Dominic Farolino Committed by Commit Bot

Remove dead redirect response code

Remove ResourceResponse::{AppendRedirectResponses, RedirectResponses}
and usages of them, because they are never called in the codebase.

Change-Id: Id1c78939b8ab1fc5cdabc044f426fee09cecc1ba
Reviewed-on: https://chromium-review.googlesource.com/c/1348738
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612553}
parent 38c448a6
...@@ -299,8 +299,6 @@ class WebURLResponse { ...@@ -299,8 +299,6 @@ class WebURLResponse {
BLINK_PLATFORM_EXPORT ExtraData* GetExtraData() const; BLINK_PLATFORM_EXPORT ExtraData* GetExtraData() const;
BLINK_PLATFORM_EXPORT void SetExtraData(ExtraData*); BLINK_PLATFORM_EXPORT void SetExtraData(ExtraData*);
BLINK_PLATFORM_EXPORT void AppendRedirectResponse(const WebURLResponse&);
#if INSIDE_BLINK #if INSIDE_BLINK
protected: protected:
// Permit subclasses to set arbitrary ResourceResponse pointer as // Permit subclasses to set arbitrary ResourceResponse pointer as
......
...@@ -425,10 +425,6 @@ void WebURLResponse::SetExtraData(WebURLResponse::ExtraData* extra_data) { ...@@ -425,10 +425,6 @@ void WebURLResponse::SetExtraData(WebURLResponse::ExtraData* extra_data) {
} }
} }
void WebURLResponse::AppendRedirectResponse(const WebURLResponse& response) {
resource_response_->AppendRedirectResponse(response.ToResourceResponse());
}
WebString WebURLResponse::AlpnNegotiatedProtocol() const { WebString WebURLResponse::AlpnNegotiatedProtocol() const {
return resource_response_->AlpnNegotiatedProtocol(); return resource_response_->AlpnNegotiatedProtocol();
} }
......
...@@ -111,19 +111,6 @@ constexpr base::TimeDelta kKeepaliveLoadersTimeout = ...@@ -111,19 +111,6 @@ constexpr base::TimeDelta kKeepaliveLoadersTimeout =
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, XSLStyleSheet) \ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, XSLStyleSheet) \
} }
void AddRedirectsToTimingInfo(Resource* resource, ResourceTimingInfo* info) {
// Store redirect responses that were packed inside the final response.
const auto& responses = resource->GetResponse().RedirectResponses();
for (wtf_size_t i = 0; i < responses.size(); ++i) {
const KURL& new_url = i + 1 < responses.size()
? KURL(responses[i + 1].Url())
: resource->GetResourceRequest().Url();
bool cross_origin =
!SecurityOrigin::AreSameSchemeHostPort(responses[i].Url(), new_url);
info->AddRedirect(responses[i], cross_origin);
}
}
ResourceLoadPriority TypeToPriority(ResourceType type) { ResourceLoadPriority TypeToPriority(ResourceType type) {
switch (type) { switch (type) {
case ResourceType::kMainResource: case ResourceType::kMainResource:
...@@ -329,9 +316,7 @@ ResourceLoadPriority ResourceFetcher::ComputeLoadPriority( ...@@ -329,9 +316,7 @@ ResourceLoadPriority ResourceFetcher::ComputeLoadPriority(
} }
static void PopulateTimingInfo(ResourceTimingInfo* info, Resource* resource) { static void PopulateTimingInfo(ResourceTimingInfo* info, Resource* resource) {
KURL initial_url = resource->GetResponse().RedirectResponses().IsEmpty() KURL initial_url = resource->GetResourceRequest().Url();
? resource->GetResourceRequest().Url()
: resource->GetResponse().RedirectResponses()[0].Url();
info->SetInitialURL(initial_url); info->SetInitialURL(initial_url);
info->SetFinalResponse(resource->GetResponse()); info->SetFinalResponse(resource->GetResponse());
} }
...@@ -1640,8 +1625,6 @@ void ResourceFetcher::HandleLoaderFinish( ...@@ -1640,8 +1625,6 @@ void ResourceFetcher::HandleLoaderFinish(
if (resource->GetType() == ResourceType::kMainResource) { if (resource->GetType() == ResourceType::kMainResource) {
DCHECK(navigation_timing_info_); DCHECK(navigation_timing_info_);
// Store redirect responses that were packed inside the final response.
AddRedirectsToTimingInfo(resource, navigation_timing_info_.get());
if (resource->GetResponse().IsHTTP()) { if (resource->GetResponse().IsHTTP()) {
PopulateTimingInfo(navigation_timing_info_.get(), resource); PopulateTimingInfo(navigation_timing_info_.get(), resource);
navigation_timing_info_->AddFinalTransferSize( navigation_timing_info_->AddFinalTransferSize(
...@@ -1650,9 +1633,6 @@ void ResourceFetcher::HandleLoaderFinish( ...@@ -1650,9 +1633,6 @@ void ResourceFetcher::HandleLoaderFinish(
} }
if (scoped_refptr<ResourceTimingInfo> info = if (scoped_refptr<ResourceTimingInfo> info =
resource_timing_info_map_.Take(resource)) { resource_timing_info_map_.Take(resource)) {
// Store redirect responses that were packed inside the final response.
AddRedirectsToTimingInfo(resource, info.get());
if (resource->GetResponse().IsHTTP() && if (resource->GetResponse().IsHTTP() &&
resource->GetResponse().HttpStatusCode() < 400) { resource->GetResponse().HttpStatusCode() < 400) {
PopulateTimingInfo(info.get(), resource); PopulateTimingInfo(info.get(), resource);
......
...@@ -431,11 +431,6 @@ void ResourceResponse::SetDecodedBodyLength(int64_t value) { ...@@ -431,11 +431,6 @@ void ResourceResponse::SetDecodedBodyLength(int64_t value) {
decoded_body_length_ = value; decoded_body_length_ = value;
} }
void ResourceResponse::AppendRedirectResponse(
const ResourceResponse& response) {
redirect_responses_.push_back(response);
}
bool ResourceResponse::Compare(const ResourceResponse& a, bool ResourceResponse::Compare(const ResourceResponse& a,
const ResourceResponse& b) { const ResourceResponse& b) {
if (a.IsNull() != b.IsNull()) if (a.IsNull() != b.IsNull())
......
...@@ -399,14 +399,6 @@ class PLATFORM_EXPORT ResourceResponse final { ...@@ -399,14 +399,6 @@ class PLATFORM_EXPORT ResourceResponse final {
return 1280; return 1280;
} }
// PlzNavigate: Even if there is redirections, only one
// ResourceResponse is built: the final response.
// The redirect response chain can be accessed by this function.
const Vector<ResourceResponse>& RedirectResponses() const {
return redirect_responses_;
}
void AppendRedirectResponse(const ResourceResponse&);
bool AsyncRevalidationRequested() const { bool AsyncRevalidationRequested() const {
return async_revalidation_requested_; return async_revalidation_requested_;
} }
...@@ -580,10 +572,6 @@ class PLATFORM_EXPORT ResourceResponse final { ...@@ -580,10 +572,6 @@ class PLATFORM_EXPORT ResourceResponse final {
// ExtraData associated with the response. // ExtraData associated with the response.
scoped_refptr<ExtraData> extra_data_; scoped_refptr<ExtraData> extra_data_;
// PlzNavigate: the redirect responses are transmitted
// inside the final response.
Vector<ResourceResponse> redirect_responses_;
}; };
inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) { inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment