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

Unified Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java

Issue 2751113004: Revert of [Cronet] Write effective experimental options to NetLog (Closed)
Patch Set: Created 3 years, 9 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698