Chromium Code Reviews| Index: components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java |
| diff --git a/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java b/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java |
| index c6e6c2cb4a8151fe21c3245cc569425c62e25437..7817e3d835bad9a6be5456a097226fcb60c092d2 100644 |
| --- a/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java |
| +++ b/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java |
| @@ -34,6 +34,7 @@ final class CronetUrlRequest implements UrlRequest { |
| private boolean mStarted = false; |
| private boolean mCanceled = false; |
| private boolean mInOnDataReceived = false; |
| + private boolean mBypassCache = false; |
| /* |
| * Synchronize access to mUrlRequestAdapter, mStarted, mCanceled and |
| @@ -270,6 +271,9 @@ final class CronetUrlRequest implements UrlRequest { |
| + header.first + "=" + header.second); |
| } |
| } |
| + if (mBypassCache) { |
| + nativeBypassCache(mUrlRequestAdapter); |
| + } |
| mStarted = true; |
| nativeStart(mUrlRequestAdapter); |
| } |
| @@ -312,6 +316,12 @@ final class CronetUrlRequest implements UrlRequest { |
| throw new UnsupportedOperationException("Not implemented yet"); |
| } |
| + @Override |
| + public void bypassCache() { |
| + checkNotStarted(); |
| + mBypassCache = true; |
|
mef
2015/02/04 20:39:42
why can't we just call nativeBypassCache here?
xunjieli
2015/02/04 21:27:05
Cronet's UrlRequestAdapter is only created in star
|
| + } |
| + |
| /** |
| * Post task to application Executor. Used for Listener callbacks |
| * and other tasks that should not be executed on network thread. |
| @@ -610,4 +620,6 @@ final class CronetUrlRequest implements UrlRequest { |
| private native boolean nativeGetWasCached(long urlRequestAdapter); |
| private native long nativeGetTotalReceivedBytes(long urlRequestAdapter); |
| + |
| + private native void nativeBypassCache(long urlRequestAdapter); |
| } |