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

Unified Diff: components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java

Issue 1984723002: Support setReadTimeout in CronetHttpURLConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove outdated include Created 4 years, 7 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
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/urlconnection/MessageLoop.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java
diff --git a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java
index 1575a696d504f4efa0b8813d9a2f5ffd485d9304..e03ce2ae45ef4fa4d4573979ce0e6d4357a3dbff 100644
--- a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java
+++ b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java
@@ -396,6 +396,15 @@ public class CronetHttpURLConnection extends HttpURLConnection {
return false;
}
+ @Override
+ public void setConnectTimeout(int timeout) {
+ // Per-request connect timeout is not supported because of late binding.
+ // Sockets are assigned to requests according to request priorities
+ // when sockets are connected. This requires requests with the same host,
+ // domain and port to have same timeout.
+ throw new UnsupportedOperationException("Not supported");
pauljensen 2016/05/19 00:51:59 I'm not sure throwing an exception here is what we
+ }
+
/**
* Used by {@link CronetInputStream} to get more data from the network
* stack. This should only be called after the request has started. Note
@@ -405,7 +414,7 @@ public class CronetHttpURLConnection extends HttpURLConnection {
*/
void getMoreData(ByteBuffer byteBuffer) throws IOException {
mRequest.read(byteBuffer);
- mMessageLoop.loop();
+ mMessageLoop.loop(getReadTimeout());
}
/**
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/urlconnection/MessageLoop.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698