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

Unified Diff: content/browser/tracing/tracing_ui.cc

Issue 12302036: Add a mode flag to the tracing framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 7 years, 10 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
« no previous file with comments | « content/browser/tracing/trace_message_filter.cc ('k') | content/public/browser/trace_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_ui.cc
diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc
index 72f6451c429c3a5d08d1a8b78ba46f52e545435b..33547fe31b95b5f221bb1a0bce1b3a4a81b37bb6 100644
--- a/content/browser/tracing/tracing_ui.cc
+++ b/content/browser/tracing/tracing_ui.cc
@@ -372,7 +372,8 @@ void TracingMessageHandler::SaveTraceFileComplete() {
void TracingMessageHandler::OnBeginTracing(const base::ListValue* args) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_EQ(args->GetSize(), (size_t) 2);
+ DCHECK_GE(args->GetSize(), (size_t) 2);
+ DCHECK_LE(args->GetSize(), (size_t) 3);
bool system_tracing_requested = false;
bool ok = args->GetBoolean(0, &system_tracing_requested);
@@ -382,12 +383,22 @@ void TracingMessageHandler::OnBeginTracing(const base::ListValue* args) {
ok = args->GetString(1, &chrome_categories);
DCHECK(ok);
+ base::debug::TraceLog::Options options =
+ base::debug::TraceLog::RECORD_UNTIL_FULL;
+ if (args->GetSize() >= 3) {
+ std::string options_;
+ ok = args->GetString(2, &options_);
+ DCHECK(ok);
+ options = base::debug::TraceLog::TraceOptionsFromString(options_);
+ }
+
trace_enabled_ = true;
// TODO(jbates) This may fail, but that's OK for current use cases.
// Ex: Multiple about:gpu traces can not trace simultaneously.
// TODO(nduca) send feedback to javascript about whether or not BeginTracing
// was successful.
- TraceController::GetInstance()->BeginTracing(this, chrome_categories);
+ TraceController::GetInstance()->BeginTracing(this, chrome_categories,
+ options);
if (system_tracing_requested) {
#if defined(OS_CHROMEOS)
« no previous file with comments | « content/browser/tracing/trace_message_filter.cc ('k') | content/public/browser/trace_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698