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

Unified Diff: components/cronet/android/cronet_url_request_adapter.cc

Issue 1359343005: Update ResponseInfo to UrlResponseInfo with API review comments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update README.md Created 5 years, 2 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: components/cronet/android/cronet_url_request_adapter.cc
diff --git a/components/cronet/android/cronet_url_request_adapter.cc b/components/cronet/android/cronet_url_request_adapter.cc
index 14115e07d9d720799a2e1b438b6ca15f0b4b0e09..70936b77fc6207f7147d3d9143585d51c5160012 100644
--- a/components/cronet/android/cronet_url_request_adapter.cc
+++ b/components/cronet/android/cronet_url_request_adapter.cc
@@ -269,7 +269,7 @@ void CronetURLRequestAdapter::OnReceivedRedirect(
cronet::Java_CronetUrlRequest_onReceivedRedirect(
env, owner_.obj(),
ConvertUTF8ToJavaString(env, redirect_info.new_url.spec()).obj(),
- redirect_info.status_code);
+ redirect_info.status_code, request->GetTotalReceivedBytes());
*defer_redirect = true;
}
@@ -283,7 +283,8 @@ void CronetURLRequestAdapter::OnSSLCertificateError(
JNIEnv* env = base::android::AttachCurrentThread();
cronet::Java_CronetUrlRequest_onError(
env, owner_.obj(), net_error,
- ConvertUTF8ToJavaString(env, net::ErrorToString(net_error)).obj());
+ ConvertUTF8ToJavaString(env, net::ErrorToString(net_error)).obj(),
+ request->GetTotalReceivedBytes());
}
void CronetURLRequestAdapter::OnResponseStarted(net::URLRequest* request) {
@@ -304,7 +305,7 @@ void CronetURLRequestAdapter::OnReadCompleted(net::URLRequest* request,
JNIEnv* env = base::android::AttachCurrentThread();
cronet::Java_CronetUrlRequest_onReadCompleted(
env, owner_.obj(), read_buffer_->byte_buffer(), bytes_read,
- read_buffer_->initial_position());
+ read_buffer_->initial_position(), request->GetTotalReceivedBytes());
// Free the read buffer. This lets the Java ByteBuffer be freed, if the
// embedder releases it, too.
read_buffer_ = nullptr;
@@ -380,7 +381,8 @@ bool CronetURLRequestAdapter::MaybeReportError(net::URLRequest* request) const {
JNIEnv* env = base::android::AttachCurrentThread();
cronet::Java_CronetUrlRequest_onError(
env, owner_.obj(), net_error,
- ConvertUTF8ToJavaString(env, net::ErrorToString(net_error)).obj());
+ ConvertUTF8ToJavaString(env, net::ErrorToString(net_error)).obj(),
+ request->GetTotalReceivedBytes());
return true;
}
« no previous file with comments | « components/cronet/README.md ('k') | components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698