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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java

Issue 26358012: Use CategoryFilter::kDefaultCategoryFilterString instead of "*" as the default category (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEFAULT_CHROME_CATEGORIES Created 7 years, 2 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: content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
index 8a900022807c6626c5cc8e4395bb39135004c516..fa344db72c89330a1a927bf335207fa7c11c2f48 100644
--- a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
+++ b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
@@ -9,6 +9,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Environment;
+import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
@@ -49,6 +50,8 @@ public class TracingControllerAndroid {
private static final String FILE_EXTRA = "file";
private static final String CATEGORIES_EXTRA = "categories";
private static final String RECORD_CONTINUOUSLY_EXTRA = "continuous";
+ private static final String DEFAULT_CHROME_CATEGORIES_PLACE_HOLDER =
+ "_DEFAULT_CHROME_CATEGORIES";
private final Context mContext;
private final TracingBroadcastReceiver mBroadcastReceiver;
@@ -113,15 +116,8 @@ public class TracingControllerAndroid {
/**
* Start profiling to a new file in the Downloads directory.
*
- * Calls #startTracing(String) with a new timestamped filename.
- *
- * @param showToasts Whether or not we want to show toasts during this profiling session.
- * When we are timing the profile run we might not want to incur extra draw overhead of showing
- * notifications about the profiling system.
- * @param categories Which categories to trace. See TracingControllerAndroid::BeginTracing()
- * (in content/public/browser/trace_controller.h) for the format.
- * @param recordContinuously Record until the user ends the trace. The trace buffer is fixed
- * size and we use it as a ring buffer during recording.
+ * Calls #startTracing(String, boolean, String, boolean) with a new timestamped filename.
+ * @see #startTracing(String, boolean, String, boolean)
*/
public boolean startTracing(boolean showToasts, String categories,
boolean recordContinuously) {
@@ -244,8 +240,11 @@ public class TracingControllerAndroid {
public void onReceive(Context context, Intent intent) {
if (intent.getAction().endsWith(ACTION_START)) {
String categories = intent.getStringExtra(CATEGORIES_EXTRA);
- if (categories == null) {
- categories = "*";
+ if (TextUtils.isEmpty(categories)) {
+ categories = nativeGetDefaultCategories();
+ } else {
+ categories = categories.replaceFirst(
+ DEFAULT_CHROME_CATEGORIES_PLACE_HOLDER, nativeGetDefaultCategories());
}
boolean recordContinuously =
intent.getStringExtra(RECORD_CONTINUOUSLY_EXTRA) != null;
@@ -269,4 +268,5 @@ public class TracingControllerAndroid {
private native boolean nativeStartTracing(int nativeTracingControllerAndroid, String filename,
String categories, boolean recordContinuously);
private native void nativeStopTracing(int nativeTracingControllerAndroid);
+ private native String nativeGetDefaultCategories();
}
« build/android/adb_profile_chrome.py ('K') | « content/browser/android/tracing_controller_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698