]> khamidou — GitHub mirrors - electron.git/commitdiff
tracing: fix docs and allow null values in file path conversion fromv8
authorRobo <hop2deep@gmail.com>
Thu, 12 Nov 2015 21:06:38 +0000 (02:36 +0530)
committerRobo <hop2deep@gmail.com>
Thu, 12 Nov 2015 21:06:38 +0000 (02:36 +0530)
atom/common/native_mate_converters/file_path_converter.h
docs/api/content-tracing.md

index 468f506de8a3c5229d22746e9e1a415cb694d854..7df1289e243be0f5f8dc9a114b3c98a1ba55ab37 100644 (file)
@@ -21,6 +21,9 @@ struct Converter<base::FilePath> {
   static bool FromV8(v8::Isolate* isolate,
                      v8::Local<v8::Value> val,
                      base::FilePath* out) {
+    if (val->IsNull())
+      return true;
+
     base::FilePath::StringType path;
     if (Converter<base::FilePath::StringType>::FromV8(isolate, val, &path)) {
       *out = base::FilePath(path);
index 2e05fc67668f5d55e38fa0f3e3b12be156668547..9fc335b3bc183563ee2cc6bec6eb2c5b19b2f578 100644 (file)
@@ -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() {