| 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 238cf24d5f8d2f8b8f4bc31a90126e0254cb4e60..de81bf3cb6ad3b3f556c7cb779e8cb464007d2d4 100644
|
| --- a/content/browser/devtools/devtools_tracing_handler.cc
|
| +++ b/content/browser/devtools/devtools_tracing_handler.cc
|
| @@ -64,6 +64,12 @@
|
| base::Unretained(this)));
|
| RegisterCommandHandler(devtools::Tracing::getCategories::kName,
|
| base::Bind(&DevToolsTracingHandler::OnGetCategories,
|
| + base::Unretained(this)));
|
| + RegisterNotificationHandler(devtools::Tracing::started::kName,
|
| + base::Bind(&DevToolsTracingHandler::OnTracingStarted,
|
| + base::Unretained(this)));
|
| + RegisterNotificationHandler(devtools::Tracing::stopped::kName,
|
| + base::Bind(&DevToolsTracingHandler::OnTracingStopped,
|
| base::Unretained(this)));
|
| }
|
|
|
| @@ -148,11 +154,6 @@
|
| scoped_refptr<DevToolsProtocol::Response>
|
| DevToolsTracingHandler::OnStart(
|
| scoped_refptr<DevToolsProtocol::Command> command) {
|
| - // If inspected target is a render process Tracing.start will be handled by
|
| - // tracing agent in the renderer.
|
| - if (target_ == Renderer)
|
| - return NULL;
|
| -
|
| is_recording_ = true;
|
|
|
| std::string categories;
|
| @@ -173,6 +174,16 @@
|
| }
|
|
|
| SetupTimer(usage_reporting_interval);
|
| +
|
| + // If inspected target is a render process Tracing.start will be handled by
|
| + // tracing agent in the renderer.
|
| + if (target_ == Renderer) {
|
| + TracingController::GetInstance()->EnableRecording(
|
| + base::debug::CategoryFilter(categories),
|
| + options,
|
| + TracingController::EnableRecordingDoneCallback());
|
| + return NULL;
|
| + }
|
|
|
| TracingController::GetInstance()->EnableRecording(
|
| base::debug::CategoryFilter(categories),
|
| @@ -217,10 +228,6 @@
|
| scoped_refptr<DevToolsProtocol::Response>
|
| DevToolsTracingHandler::OnEnd(
|
| scoped_refptr<DevToolsProtocol::Command> command) {
|
| - // If inspected target is a render process Tracing.end will be handled by
|
| - // tracing agent in the renderer.
|
| - if (target_ == Renderer)
|
| - return NULL;
|
| DisableRecording(
|
| base::Bind(&DevToolsTracingHandler::BeginReadingRecordingResult,
|
| weak_factory_.GetWeakPtr()));
|
| @@ -265,7 +272,8 @@
|
| SendAsyncResponse(command->SuccessResponse(response));
|
| }
|
|
|
| -void DevToolsTracingHandler::EnableTracing(const std::string& category_filter) {
|
| +void DevToolsTracingHandler::OnTracingStarted(
|
| + scoped_refptr<DevToolsProtocol::Notification> notification) {
|
| if (is_recording_)
|
| return;
|
| is_recording_ = true;
|
| @@ -273,13 +281,13 @@
|
| SetupTimer(kDefaultReportingInterval);
|
|
|
| TracingController::GetInstance()->EnableRecording(
|
| - base::debug::CategoryFilter(category_filter),
|
| + base::debug::CategoryFilter(kDefaultCategories),
|
| base::debug::TraceOptions(),
|
| TracingController::EnableRecordingDoneCallback());
|
| - SendNotification(devtools::Tracing::started::kName, NULL);
|
| -}
|
| -
|
| -void DevToolsTracingHandler::DisableTracing() {
|
| +}
|
| +
|
| +void DevToolsTracingHandler::OnTracingStopped(
|
| + scoped_refptr<DevToolsProtocol::Notification> notification) {
|
| if (!is_recording_)
|
| return;
|
| is_recording_ = false;
|
|
|