| Index: components/cronet/android/java/src/org/chromium/net/urlconnection/CronetOutputStream.java
|
| diff --git a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetOutputStream.java b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetOutputStream.java
|
| index 03c4b4bae3378684f3183dca75011d1a23987d1e..c73426a6a94e07ce1f12cba93a6275cc402a9537 100644
|
| --- a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetOutputStream.java
|
| +++ b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetOutputStream.java
|
| @@ -54,13 +54,21 @@ abstract class CronetOutputStream extends OutputStream {
|
| */
|
| protected void checkNotClosed() throws IOException {
|
| if (mRequestCompleted) {
|
| - if (mException != null) {
|
| - throw mException;
|
| - }
|
| + checkNoException();
|
| throw new IOException("Writing after request completed.");
|
| }
|
| if (mClosed) {
|
| throw new IOException("Stream has been closed.");
|
| }
|
| }
|
| +
|
| + /**
|
| + * Throws the same IOException that the request is failed with. If there
|
| + * is no exception reported, this method is no-op.
|
| + */
|
| + protected void checkNoException() throws IOException {
|
| + if (mException != null) {
|
| + throw mException;
|
| + }
|
| + }
|
| }
|
|
|