From: Robo Date: Thu, 12 Nov 2015 21:06:38 +0000 (+0530) Subject: tracing: fix docs and allow null values in file path conversion fromv8 X-Git-Tag: v0.35.0~12^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3d5437e0a45b884d850ff125d38c0c49edc4d86f;p=electron.git tracing: fix docs and allow null values in file path conversion fromv8 --- diff --git a/atom/common/native_mate_converters/file_path_converter.h b/atom/common/native_mate_converters/file_path_converter.h index 468f506d..7df1289e 100644 --- a/atom/common/native_mate_converters/file_path_converter.h +++ b/atom/common/native_mate_converters/file_path_converter.h @@ -21,6 +21,9 @@ struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Local val, base::FilePath* out) { + if (val->IsNull()) + return true; + base::FilePath::StringType path; if (Converter::FromV8(isolate, val, &path)) { *out = base::FilePath(path); diff --git a/docs/api/content-tracing.md b/docs/api/content-tracing.md index 2e05fc67..9fc335b3 100644 --- a/docs/api/content-tracing.md +++ b/docs/api/content-tracing.md @@ -6,9 +6,14 @@ so you need to open `chrome://tracing/` in a Chrome browser and load the generated file to view the result. ```javascript -var contentTracing = require('content-tracing'); +const contentTracing = require('content-tracing'); -contentTracing.startRecording('*', contentTracing.DEFAULT_OPTIONS, function() { +const options = { + categoryFilter: '*', + traceOptions: 'record-until-full,enable-sampling' +} + +contentTracing.startRecording(options, function() { console.log('Tracing started'); setTimeout(function() {