summaryrefslogtreecommitdiffstats
path: root/content/browser/android/tracing_controller_android.cc
diff options
context:
space:
mode:
authornednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-04 16:30:52 +0000
committernednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-04 16:30:52 +0000
commit4753b9ec770f3f51722fc7df6b0568479c19acaf (patch)
treee5252f3ba3ae220e3c3c80213dc6d4088fedfe77 /content/browser/android/tracing_controller_android.cc
parent99c453b803e326a1ff2a9e60bfc43ccc265401c3 (diff)
downloadchromium_src-4753b9ec770f3f51722fc7df6b0568479c19acaf.zip
chromium_src-4753b9ec770f3f51722fc7df6b0568479c19acaf.tar.gz
chromium_src-4753b9ec770f3f51722fc7df6b0568479c19acaf.tar.bz2
Refactor tracing to pass around base::debug::TraceOptions to reduce spaghetti
Previously, the options for tracing were passed around with different ad hoc systems. Strings in some places, base::debug::TraceOptions enum in others, and a content::TraceOptions in yet another. There were two separate ad-hoc string formats. Similar messes were present with category filters: sometimes we passed strings, sometimes the CategoryFilter. This patch though enormous looking simply consolidates all this ad-hockery into base::debug::TraceOptions. It may look like the call sites have gotten more verbose, but the end result of this is a consistent understanding of TraceOptions. There is one exception to this consolidation: devtools has to maintain its own mapping of string->TraceOptions encoding. This is because DevTools makes guarantees about backward compatibility: if base changes its mind about the string form of a TraceOption, devtools needs to keep supporting the old form. BUG=396081 TBR=cevans@chromium.org Review URL: https://codereview.chromium.org/425593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android/tracing_controller_android.cc')
-rw-r--r--content/browser/android/tracing_controller_android.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/content/browser/android/tracing_controller_android.cc b/content/browser/android/tracing_controller_android.cc
index a9c5b40..f89d472d 100644
--- a/content/browser/android/tracing_controller_android.cc
+++ b/content/browser/android/tracing_controller_android.cc
@@ -32,17 +32,18 @@ void TracingControllerAndroid::Destroy(JNIEnv* env, jobject obj) {
bool TracingControllerAndroid::StartTracing(JNIEnv* env,
jobject obj,
jstring jcategories,
- jboolean record_continuously) {
+ jstring jtraceoptions) {
std::string categories =
base::android::ConvertJavaStringToUTF8(env, jcategories);
+ std::string trace_options =
+ base::android::ConvertJavaStringToUTF8(env, jtraceoptions);
// This log is required by adb_profile_chrome.py.
LOG(WARNING) << "Logging performance trace to file";
return TracingController::GetInstance()->EnableRecording(
- categories,
- record_continuously ? TracingController::RECORD_CONTINUOUSLY
- : TracingController::DEFAULT_OPTIONS,
+ base::debug::CategoryFilter(categories),
+ base::debug::TraceOptions(trace_options),
TracingController::EnableRecordingDoneCallback());
}