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

Unified Diff: content/browser/devtools/devtools_tracing_handler.cc

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address joechan's comments Created 6 years, 4 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/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 9b1f8e7d1ac61749973ec0e13a86e1aebf7bae7e..19abb63d9895a407e5cd47f71439b094d91f0708 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"
@@ -128,23 +129,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;
}
}
- return static_cast<TracingController::Options>(ret);
+ return ret;
}
scoped_refptr<DevToolsProtocol::Response>
@@ -153,7 +154,7 @@ DevToolsTracingHandler::OnStart(
is_recording_ = true;
std::string categories;
- TracingController::Options options = TracingController::DEFAULT_OPTIONS;
+ base::debug::TraceOptions options;
double usage_reporting_interval = 0.0;
base::DictionaryValue* params = command->params();
@@ -175,12 +176,15 @@ DevToolsTracingHandler::OnStart(
// tracing agent in the renderer.
if (target_ == Renderer) {
TracingController::GetInstance()->EnableRecording(
- categories, options, TracingController::EnableRecordingDoneCallback());
+ base::debug::CategoryFilter(categories),
+ options,
+ TracingController::EnableRecordingDoneCallback());
return NULL;
}
TracingController::GetInstance()->EnableRecording(
- categories, options,
+ base::debug::CategoryFilter(categories),
+ options,
base::Bind(&DevToolsTracingHandler::OnRecordingEnabled,
weak_factory_.GetWeakPtr(),
command));
@@ -274,8 +278,8 @@ void DevToolsTracingHandler::OnTracingStarted(
SetupTimer(kDefaultReportingInterval);
TracingController::GetInstance()->EnableRecording(
- kDefaultCategories,
- TracingController::DEFAULT_OPTIONS,
+ base::debug::CategoryFilter(kDefaultCategories),
+ base::debug::TraceOptions(),
TracingController::EnableRecordingDoneCallback());
}
« no previous file with comments | « content/browser/devtools/devtools_tracing_handler.h ('k') | content/browser/media/webrtc_getusermedia_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698