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

Unified Diff: content/browser/streams/stream_url_request_job.cc

Issue 2612683002: PlzNavigate: Pass the encoded resource transfer size to the renderer. (Closed)
Patch Set: PlzNavigate: Pass the encoded resource transfer size to the renderer. Created 3 years, 12 months 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
Index: content/browser/streams/stream_url_request_job.cc
diff --git a/content/browser/streams/stream_url_request_job.cc b/content/browser/streams/stream_url_request_job.cc
index 1659eb05f7665bf873663040495cf6e3f469157c..f6ea712a4cb4f543262802ad99725b8e04b77d11 100644
--- a/content/browser/streams/stream_url_request_job.cc
+++ b/content/browser/streams/stream_url_request_job.cc
@@ -145,6 +145,15 @@ int StreamURLRequestJob::GetResponseCode() const {
return response_info_->headers->response_code();
}
+int64_t StreamURLRequestJob::GetTotalReceivedBytes() const {
+ int64_t total_received_bytes = 0;
+ if (response_info_)
+ total_received_bytes = response_info_->headers->raw_headers().size();
+ if (stream_.get())
+ total_received_bytes += total_bytes_read_;
+ return total_received_bytes;
+}
+
void StreamURLRequestJob::DidStart() {
if (range_parse_result() == net::OK && ranges().size() > 0) {
// Only one range is supported, and it must start at the first byte.

Powered by Google App Engine
This is Rietveld 408576698