Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: net/test/url_request/url_request_failed_job.cc

Issue 2514713002: Send encoded_body_length to renderer when response completed (1/3) (Closed)
Patch Set: merge https://codereview.chromium.org/2526653002/ Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/url_request/url_request_failed_job.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/url_request/url_request_failed_job.cc
diff --git a/net/test/url_request/url_request_failed_job.cc b/net/test/url_request/url_request_failed_job.cc
index 3e1e5664934baeb20ee2d2f432a0d46902ff6284..1de2910eb3fb32b549835ca120ae8e09f9e32247 100644
--- a/net/test/url_request/url_request_failed_job.cc
+++ b/net/test/url_request/url_request_failed_job.cc
@@ -84,6 +84,7 @@ URLRequestFailedJob::URLRequestFailedJob(URLRequest* request,
: URLRequestJob(request, network_delegate),
phase_(phase),
net_error_(net_error),
+ total_received_bytes_(0),
weak_factory_(this) {
CHECK_GE(phase, URLRequestFailedJob::FailurePhase::START);
CHECK_LE(phase, URLRequestFailedJob::FailurePhase::READ_ASYNC);
@@ -131,6 +132,10 @@ void URLRequestFailedJob::PopulateNetErrorDetails(
}
}
+int64_t URLRequestFailedJob::GetTotalReceivedBytes() const {
+ return total_received_bytes_;
+}
+
// static
void URLRequestFailedJob::AddUrlHandler() {
return AddUrlHandlerForHostname(kMockHostname);
@@ -190,7 +195,9 @@ void URLRequestFailedJob::StartAsync() {
}
return;
}
- response_info_.headers = new net::HttpResponseHeaders("HTTP/1.1 200 OK");
+ const std::string headers = "HTTP/1.1 200 OK";
+ response_info_.headers = new net::HttpResponseHeaders(headers);
+ total_received_bytes_ = headers.size();
NotifyHeadersComplete();
}
« no previous file with comments | « net/test/url_request/url_request_failed_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698