summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTim Volodine <timvolodine@google.com>2018-03-19 20:07:23 +0000
committerTim Volodine <timvolodine@google.com>2018-03-21 17:12:20 +0000
commit1a07ccc07e9cc5b0ba8e8922979a486bd83f333d (patch)
tree415b95a8cdcff0f2e32fbf8074cb4a359725e74c /core/java
parentc16de0565bd0dceade35237daef7c8a5abf796cd (diff)
WebView Tracing API: remove LARGE_BUFFER, make RECORD_CONTINUOUSLY the default mode
This patch: - remove the RECORD_UNTIL_FULL_LARGE_BUFFER tracing option, because this does not appear really useful in the production setting as the buffer size limit exceeds the device memory and can grow uncontrollably large. - make RECORD_CONTINUOUSLY the default mode for tracing, to make sure the least memory is used by default (typically 4x less than the previous default RECORD_UNTIL_FULL). - add some missing IntDef values (to make them match with the constants) BUG: 63750258 Test: CTS Change-Id: Ib3698273dee776ebc7a8388fc1bd8c80255e3b63
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/webkit/TracingConfig.java43
-rw-r--r--core/java/android/webkit/TracingController.java5
2 files changed, 21 insertions, 27 deletions
diff --git a/core/java/android/webkit/TracingConfig.java b/core/java/android/webkit/TracingConfig.java
index 68badecaec3a..d95ca61dff3f 100644
--- a/core/java/android/webkit/TracingConfig.java
+++ b/core/java/android/webkit/TracingConfig.java
@@ -35,9 +35,9 @@ public class TracingConfig {
private @TracingMode int mTracingMode;
/** @hide */
- @IntDef(flag = true, value = {CATEGORIES_NONE, CATEGORIES_WEB_DEVELOPER,
- CATEGORIES_INPUT_LATENCY, CATEGORIES_RENDERING, CATEGORIES_JAVASCRIPT_AND_RENDERING,
- CATEGORIES_FRAME_VIEWER})
+ @IntDef(flag = true, value = {CATEGORIES_NONE, CATEGORIES_ALL, CATEGORIES_ANDROID_WEBVIEW,
+ CATEGORIES_WEB_DEVELOPER, CATEGORIES_INPUT_LATENCY, CATEGORIES_RENDERING,
+ CATEGORIES_JAVASCRIPT_AND_RENDERING, CATEGORIES_FRAME_VIEWER})
@Retention(RetentionPolicy.SOURCE)
public @interface PredefinedCategories {}
@@ -90,34 +90,28 @@ public class TracingConfig {
public static final int CATEGORIES_FRAME_VIEWER = 1 << 6;
/** @hide */
- @IntDef({RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY, RECORD_UNTIL_FULL_LARGE_BUFFER})
+ @IntDef({RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY})
@Retention(RetentionPolicy.SOURCE)
public @interface TracingMode {}
/**
- * Record trace events until the internal tracing buffer is full. Default tracing mode.
- * Typically the buffer memory usage is between {@link #RECORD_CONTINUOUSLY} and the
- * {@link #RECORD_UNTIL_FULL_LARGE_BUFFER}. Depending on the implementation typically allows
- * up to 256k events to be stored.
+ * Record trace events until the internal tracing buffer is full.
+ *
+ * Typically the buffer memory usage is larger than {@link #RECORD_CONTINUOUSLY}.
+ * Depending on the implementation typically allows up to 256k events to be stored.
*/
public static final int RECORD_UNTIL_FULL = 0;
/**
- * Record trace events continuously using an internal ring buffer. Overwrites
- * old events if they exceed buffer capacity. Uses less memory than both
- * {@link #RECORD_UNTIL_FULL} and {@link #RECORD_UNTIL_FULL_LARGE_BUFFER} modes.
- * Depending on the implementation typically allows up to 64k events to be stored.
+ * Record trace events continuously using an internal ring buffer. Default tracing mode.
+ *
+ * Overwrites old events if they exceed buffer capacity. Uses less memory than the
+ * {@link #RECORD_UNTIL_FULL} mode. Depending on the implementation typically allows
+ * up to 64k events to be stored.
*/
public static final int RECORD_CONTINUOUSLY = 1;
/**
- * Record trace events using a larger internal tracing buffer until it is full.
- * Uses significantly more memory than {@link #RECORD_UNTIL_FULL} and may not be
- * suitable on devices with smaller RAM.
- */
- public static final int RECORD_UNTIL_FULL_LARGE_BUFFER = 2;
-
- /**
* @hide
*/
public TracingConfig(@PredefinedCategories int predefinedCategories,
@@ -182,7 +176,7 @@ public class TracingConfig {
public static class Builder {
private @PredefinedCategories int mPredefinedCategories = CATEGORIES_NONE;
private final List<String> mCustomIncludedCategories = new ArrayList<String>();
- private @TracingMode int mTracingMode = RECORD_UNTIL_FULL;
+ private @TracingMode int mTracingMode = RECORD_CONTINUOUSLY;
/**
* Default constructor for Builder.
@@ -202,7 +196,9 @@ public class TracingConfig {
*
* @param predefinedCategories list or bitmask of predefined category sets to use:
* {@link #CATEGORIES_NONE}, {@link #CATEGORIES_ALL},
- * {@link #CATEGORIES_WEB_DEVELOPER}, {@link #CATEGORIES_INPUT_LATENCY},
+ * {@link #CATEGORIES_ANDROID_WEBVIEW},
+ * {@link #CATEGORIES_WEB_DEVELOPER},
+ * {@link #CATEGORIES_INPUT_LATENCY},
* {@link #CATEGORIES_RENDERING},
* {@link #CATEGORIES_JAVASCRIPT_AND_RENDERING} or
* {@link #CATEGORIES_FRAME_VIEWER}.
@@ -250,9 +246,8 @@ public class TracingConfig {
/**
* Sets the tracing mode for this configuration.
*
- * @param tracingMode tracing mode to use, one of {@link #RECORD_UNTIL_FULL},
- * {@link #RECORD_CONTINUOUSLY} or
- * {@link #RECORD_UNTIL_FULL_LARGE_BUFFER}.
+ * @param tracingMode tracing mode to use, one of {@link #RECORD_UNTIL_FULL} or
+ * {@link #RECORD_CONTINUOUSLY}.
* @return The builder to facilitate chaining.
*/
public Builder setTracingMode(@TracingMode int tracingMode) {
diff --git a/core/java/android/webkit/TracingController.java b/core/java/android/webkit/TracingController.java
index 7871021a33c8..50068f5abfb2 100644
--- a/core/java/android/webkit/TracingController.java
+++ b/core/java/android/webkit/TracingController.java
@@ -60,9 +60,8 @@ public abstract class TracingController {
* Starts tracing all webviews. Depending on the trace mode in traceConfig
* specifies how the trace events are recorded.
*
- * For tracing modes {@link TracingConfig#RECORD_UNTIL_FULL},
- * {@link TracingConfig#RECORD_CONTINUOUSLY} and
- * {@link TracingConfig#RECORD_UNTIL_FULL_LARGE_BUFFER} the events are recorded
+ * For tracing modes {@link TracingConfig#RECORD_UNTIL_FULL} and
+ * {@link TracingConfig#RECORD_CONTINUOUSLY} the events are recorded
* using an internal buffer and flushed to the outputStream when
* {@link #stop(OutputStream, Executor)} is called.
*