Commit e47392b3 authored by mmenke's avatar mmenke Committed by Commit bot

Remove URLRequestJob::GetResponseCode implementations

from content, chrome, and net/.

URLRequestJob itself now has a default implementation, which gets
the response code from the headers returned by GetResponseInfo.
We eventually want to remove this method, since it's redundant,
and has weird behavior for just when it is and is not safe to
call.

BUG=688481

Review-Url: https://codereview.chromium.org/2835533002
Cr-Commit-Position: refs/heads/master@{#467839}
parent 8c6a6fa5
......@@ -639,13 +639,6 @@ bool OfflinePageRequestJob::CopyFragmentOnRedirect(const GURL& location) const {
return false;
}
int OfflinePageRequestJob::GetResponseCode() const {
if (!fake_headers_for_redirect_)
return URLRequestFileJob::GetResponseCode();
return net::URLRequestRedirectJob::REDIRECT_302_FOUND;
}
void OfflinePageRequestJob::OnOpenComplete(int result) {
UMA_HISTOGRAM_SPARSE_SLOWLY("OfflinePages.RequestJob.OpenFileErrorCode",
-result);
......
......@@ -91,7 +91,6 @@ class OfflinePageRequestJob : public net::URLRequestFileJob {
void GetResponseInfo(net::HttpResponseInfo* info) override;
void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
bool CopyFragmentOnRedirect(const GURL& location) const override;
int GetResponseCode() const override;
// net::URLRequestFileJob overrides:
void OnOpenComplete(int result) override;
......
......@@ -145,7 +145,6 @@ class URLRequestChromeJob : public net::URLRequestJob {
void Kill() override;
int ReadRawData(net::IOBuffer* buf, int buf_size) override;
bool GetMimeType(std::string* mime_type) const override;
int GetResponseCode() const override;
void GetResponseInfo(net::HttpResponseInfo* info) override;
std::unique_ptr<net::SourceStream> SetUpSourceStream() override;
......@@ -358,10 +357,6 @@ bool URLRequestChromeJob::GetMimeType(std::string* mime_type) const {
return !mime_type_.empty();
}
int URLRequestChromeJob::GetResponseCode() const {
return net::HTTP_OK;
}
void URLRequestChromeJob::GetResponseInfo(net::HttpResponseInfo* info) {
DCHECK(!info->headers.get());
// Set the headers so that requests serviced by ChromeURLDataManager return a
......
......@@ -109,7 +109,6 @@ class TestDownloadRequestHandler::PartialResponseJob
void GetResponseInfo(net::HttpResponseInfo* response_info) override;
int64_t GetTotalReceivedBytes() const override;
bool GetMimeType(std::string* mime_type) const override;
int GetResponseCode() const override;
int ReadRawData(net::IOBuffer* buf, int buf_size) override;
private:
......@@ -275,11 +274,6 @@ bool TestDownloadRequestHandler::PartialResponseJob::GetMimeType(
return !parameters_->content_type.empty();
}
int TestDownloadRequestHandler::PartialResponseJob::GetResponseCode() const {
return response_info_.headers.get() ? response_info_.headers->response_code()
: 0;
}
int TestDownloadRequestHandler::PartialResponseJob::ReadRawData(
net::IOBuffer* buf,
int buf_size) {
......
......@@ -296,12 +296,6 @@ void URLRequestTestJob::GetLoadTimingInfo(
load_timing_info->request_start_time = request_start_time;
}
int URLRequestTestJob::GetResponseCode() const {
if (response_headers_.get())
return response_headers_->response_code();
return -1;
}
int64_t URLRequestTestJob::GetTotalReceivedBytes() const {
return response_headers_length_ + offset_;
}
......
......@@ -138,7 +138,6 @@ class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob {
bool GetMimeType(std::string* mime_type) const override;
void GetResponseInfo(HttpResponseInfo* info) override;
void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
int GetResponseCode() const override;
int64_t GetTotalReceivedBytes() const override;
bool IsRedirectResponse(GURL* location, int* http_status_code) override;
......
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