Browse Source

tracing: fix docs and allow null values in file path conversion fromv8

Robo 9 years ago
parent
commit
3d5437e0a4

+ 3 - 0
atom/common/native_mate_converters/file_path_converter.h

@@ -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);

+ 7 - 2
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() {