| Index: components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
|
| diff --git a/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java b/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
|
| index 629b8d9e4b42347cf71cf62303b2960eb5997b0d..16824f9466cb26171a14cbc526dda2e15e9bd31c 100644
|
| --- a/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
|
| +++ b/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
|
| @@ -148,6 +148,13 @@
|
| @GuardedBy("mLock")
|
| private boolean mIsLogging;
|
|
|
| + /**
|
| + * True if a NetLog observer that writes to disk with a bounded amount of space has been
|
| + * activated by calling StartNetLogToDisk().
|
| + */
|
| + @GuardedBy("mLock")
|
| + private boolean mNetLogToDisk;
|
| +
|
| @UsedByReflection("CronetEngine.java")
|
| public CronetUrlRequestContext(final CronetEngineBuilderImpl builder) {
|
| CronetLibraryLoader.ensureInitialized(builder.getContext(), builder);
|
| @@ -287,6 +294,7 @@
|
| checkHaveAdapter();
|
| nativeStartNetLogToDisk(mUrlRequestContextAdapter, dirPath, logAll, maxSize);
|
| mIsLogging = true;
|
| + mNetLogToDisk = true;
|
| }
|
| }
|
|
|
| @@ -299,6 +307,9 @@
|
| checkHaveAdapter();
|
| nativeStopNetLog(mUrlRequestContextAdapter);
|
| mIsLogging = false;
|
| + if (!mNetLogToDisk) {
|
| + return;
|
| + }
|
| mStopNetLogCompleted = new ConditionVariable();
|
| }
|
| mStopNetLogCompleted.block();
|
| @@ -306,6 +317,9 @@
|
|
|
| @CalledByNative
|
| public void stopNetLogCompleted() {
|
| + synchronized (mLock) {
|
| + mNetLogToDisk = false;
|
| + }
|
| mStopNetLogCompleted.open();
|
| }
|
|
|
|
|