Chromium Code Reviews| Index: content/browser/devtools/devtools_tracing_handler.cc |
| diff --git a/content/browser/devtools/devtools_tracing_handler.cc b/content/browser/devtools/devtools_tracing_handler.cc |
| index 981c2047836269c9959959c32a324101ed73f4a1..7912568c01acee0033c1fe67cd29fd9e667bba39 100644 |
| --- a/content/browser/devtools/devtools_tracing_handler.cc |
| +++ b/content/browser/devtools/devtools_tracing_handler.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind.h" |
| #include "base/callback.h" |
| +#include "base/debug/trace_event_impl.h" |
| #include "base/file_util.h" |
| #include "base/json/json_reader.h" |
| #include "base/json/json_writer.h" |
| @@ -116,23 +117,23 @@ void DevToolsTracingHandler::OnTraceDataCollected( |
| SendRawMessage(message); |
| } |
| -TracingController::Options DevToolsTracingHandler::TraceOptionsFromString( |
| +base::debug::TraceOptions DevToolsTracingHandler::TraceOptionsFromString( |
| const std::string& options) { |
| std::vector<std::string> split; |
| std::vector<std::string>::iterator iter; |
| - int ret = 0; |
| + base::debug::TraceOptions ret; |
| base::SplitString(options, ',', &split); |
| for (iter = split.begin(); iter != split.end(); ++iter) { |
| if (*iter == kRecordUntilFull) { |
| - ret &= ~TracingController::RECORD_CONTINUOUSLY; |
| + ret.record_mode = base::debug::RECORD_UNTIL_FULL; |
| } else if (*iter == kRecordContinuously) { |
| - ret |= TracingController::RECORD_CONTINUOUSLY; |
| + ret.record_mode = base::debug::RECORD_CONTINUOUSLY; |
| } else if (*iter == kEnableSampling) { |
| - ret |= TracingController::ENABLE_SAMPLING; |
| + ret.enable_sampling = true; |
|
dsinclair
2014/07/30 14:25:26
Should we add systrace here as well?
nednguyen
2014/07/30 16:51:15
I would leave this to another patch since it's a d
|
| } |
| } |
| - return static_cast<TracingController::Options>(ret); |
| + return ret; |
| } |
| scoped_refptr<DevToolsProtocol::Response> |
| @@ -144,7 +145,7 @@ DevToolsTracingHandler::OnStart( |
| if (params) |
| params->GetString(devtools::Tracing::start::kParamCategories, &categories); |
| - TracingController::Options options = TracingController::DEFAULT_OPTIONS; |
| + base::debug::TraceOptions options; |
| if (params && params->HasKey(devtools::Tracing::start::kParamOptions)) { |
| std::string options_param; |
| params->GetString(devtools::Tracing::start::kParamOptions, &options_param); |
| @@ -177,12 +178,15 @@ DevToolsTracingHandler::OnStart( |
| // tracing agent in the renderer. |
| if (target_ == Renderer) { |
| TracingController::GetInstance()->EnableRecording( |
| - categories, options, TracingController::EnableRecordingDoneCallback()); |
| + base::debug::CategoryFilter(categories), |
|
dsinclair
2014/07/30 14:25:26
unrelated?
nednguyen
2014/07/30 16:51:15
ditto
|
| + options, |
| + TracingController::EnableRecordingDoneCallback()); |
| return NULL; |
| } |
| TracingController::GetInstance()->EnableRecording( |
| - categories, options, |
| + base::debug::CategoryFilter(categories), |
|
dsinclair
2014/07/30 14:25:26
Unrelated?
nednguyen
2014/07/30 16:51:15
ditto
|
| + options, |
| base::Bind(&DevToolsTracingHandler::OnTracingStarted, |
| weak_factory_.GetWeakPtr(), |
| command)); |