diff --git a/atom/browser/api/atom_api_content_tracing.cc b/atom/browser/api/atom_api_content_tracing.cc index 42295fd26c..28a95aa71e 100644 --- a/atom/browser/api/atom_api_content_tracing.cc +++ b/atom/browser/api/atom_api_content_tracing.cc @@ -62,31 +62,26 @@ namespace { void Initialize(v8::Handle exports, v8::Handle unused, v8::Handle context, void* priv) { - TracingController* controller = TracingController::GetInstance(); + auto controller = base::Unretained(TracingController::GetInstance()); mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("getCategories", base::Bind( - &TracingController::GetCategories, base::Unretained(controller))); + &TracingController::GetCategories, controller)); dict.SetMethod("startRecording", base::Bind( - &TracingController::EnableRecording, base::Unretained(controller))); + &TracingController::EnableRecording, controller)); dict.SetMethod("stopRecording", base::Bind( - &TracingController::DisableRecording, - base::Unretained(controller), - nullptr)); + &TracingController::DisableRecording, controller, nullptr)); dict.SetMethod("startMonitoring", base::Bind( - &TracingController::EnableMonitoring, base::Unretained(controller))); + &TracingController::EnableMonitoring, controller)); dict.SetMethod("stopMonitoring", base::Bind( - &TracingController::DisableMonitoring, base::Unretained(controller))); + &TracingController::DisableMonitoring, controller)); dict.SetMethod("captureMonitoringSnapshot", base::Bind( - &TracingController::CaptureMonitoringSnapshot, - base::Unretained(controller), - nullptr)); - dict.SetMethod("getTraceBufferPercentFull", base::Bind( - &TracingController::GetTraceBufferPercentFull, - base::Unretained(controller))); + &TracingController::CaptureMonitoringSnapshot, controller, nullptr)); + dict.SetMethod("getTraceBufferUsage", base::Bind( + &TracingController::GetTraceBufferUsage, controller)); dict.SetMethod("setWatchEvent", base::Bind( - &TracingController::SetWatchEvent, base::Unretained(controller))); + &TracingController::SetWatchEvent, controller)); dict.SetMethod("cancelWatchEvent", base::Bind( - &TracingController::CancelWatchEvent, base::Unretained(controller))); + &TracingController::CancelWatchEvent, controller)); } } // namespace diff --git a/docs/api/content-tracing.md b/docs/api/content-tracing.md index e020b3a55a..adf1c5a3f5 100644 --- a/docs/api/content-tracing.md +++ b/docs/api/content-tracing.md @@ -86,8 +86,8 @@ Start monitoring on all processes. Monitoring begins immediately locally, and asynchronously on child processes as soon as they receive the `startMonitoring` request. -Once all child processes have acked to the `startMonitoring` request, `callback` -will be called back. +Once all child processes have acked to the `startMonitoring` request, +`callback` will be called back. ## tracing.stopMonitoring(callback); @@ -115,12 +115,12 @@ Once all child processes have acked to the `captureMonitoringSnapshot` request, `callback` will be called back with a file that contains the traced data. -## tracing.getTraceBufferPercentFull(callback) +## tracing.getTraceBufferUsage(callback) * `callback` Function -Get the maximum across processes of trace buffer percent full state. When the -TraceBufferPercentFull value is determined, the `callback` is called. +Get the maximum across processes of trace buffer percent full state. When the +TraceBufferUsage value is determined, the `callback` is called. ## tracing.setWatchEvent(categoryName, eventName, callback) @@ -128,7 +128,8 @@ TraceBufferPercentFull value is determined, the `callback` is called. * `eventName` String * `callback` Function -`callback` will will be called every time the given event occurs on any process. +`callback` will will be called every time the given event occurs on any +process. ## tracing.cancelWatchEvent()