Chromium Code Reviews| 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..ecf129c21057a9ed65cbb9b3cfbb5d779a6766f8 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,20 @@ void TracingMessageHandler::OnBeginTracing(const base::ListValue* args) { |
| ok = args->GetString(1, &chrome_categories); |
| DCHECK(ok); |
| + base::debug::TraceLog::TraceMode mode = base::debug::TraceLog::UNTIL_FULL; |
| + if (args->GetSize() == 3) { |
|
nduca
2013/02/21 05:40:16
would be less fragile if you wrote >= 3
dsinclair
2013/02/21 16:26:04
Done.
|
| + std::string mode_; |
| + ok = args->GetString(2, &mode_); |
| + DCHECK(ok); |
| + mode = base::debug::TraceLog::TraceModeFromString(mode_); |
|
nduca
2013/02/21 05:40:16
might check with pavel, but i think you need to do
pfeldman
2013/02/21 05:49:24
Yep, you should have local conversion barrier in t
dsinclair
2013/02/21 16:26:04
Done.
dsinclair
2013/02/21 16:26:04
Done.
I've made it a comma separated list, so dev
|
| + } |
| + |
| 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, mode); |
| if (system_tracing_requested) { |
| #if defined(OS_CHROMEOS) |