Chromium Code Reviews| Index: components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java |
| diff --git a/components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java b/components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java |
| index 21ce9c94bf196dfd40d18dee435d17c47a51b28c..cf14551e75b848cc6023f4087afce388183b2125 100644 |
| --- a/components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java |
| +++ b/components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java |
| @@ -221,6 +221,9 @@ class HttpUrlConnectionUrlRequest implements HttpUrlRequest { |
| return; |
| } |
| + mListener.onResponseStarted(this); |
| + |
| + |
|
mmenke
2014/05/09 16:41:40
nit: Remove extra blank line.
mef
2014/05/09 18:49:16
Done.
|
| mResponseStream = isError(mHttpStatusCode) ? mConnection |
| .getErrorStream() |
| : stream; |
| @@ -250,6 +253,14 @@ class HttpUrlConnectionUrlRequest implements HttpUrlRequest { |
| } catch (IOException e) { |
| mException = e; |
| } finally { |
| + if (mPostDataChannel != null) { |
| + try { |
| + mPostDataChannel.close(); |
| + } catch (IOException e) { |
| + // Ignore |
| + } |
| + } |
| + |
| // Don't call onRequestComplete yet if we are reading the response |
| // on a separate thread |
| if (!readingResponse) { |
| @@ -425,6 +436,15 @@ class HttpUrlConnectionUrlRequest implements HttpUrlRequest { |
| return mContentType; |
| } |
| + |
| + @Override |
| + public String getHeader(String name) { |
| + if (mConnection == null) { |
| + throw new IllegalStateException("Response headers not available"); |
| + } |
| + return mConnection.getHeaderField(name); |
| + } |
| + |
| private void validateNotStarted() { |
| if (mStarted) { |
| throw new IllegalStateException("Request already started"); |