lib/third_party/tracing/importer/import.js
function(traces) {
      if (tr.isHeadless)
        throw new Error('Cannot use this method in headless mode.');

      var overlay = tr.ui.b.Overlay();
      overlay.title = 'Importing...';
      overlay.userCanClose = false;
      overlay.msgEl = document.createElement('div');
      overlay.appendChild(overlay.msgEl);
      overlay.msgEl.style.margin = '20px';
      overlay.update = function(msg) {
        this.msgEl.textContent = msg;
      }
      overlay.visible = true;

      var promise =
          tr.b.Task.RunWhenIdle(this.createImportTracesTask(overlay, traces));
      promise.then(
          function() { overlay.visible = false; },
          function(err) { overlay.visible = false; }
      );
      return promise;
    }
function(traces) {
      if (tr.isHeadless)
        throw new Error('Cannot use this method in headless mode.');

      var overlay = tr.ui.b.Overlay();
      overlay.title = 'Importing...';
      overlay.userCanClose = false;
      overlay.msgEl = document.createElement('div');
      overlay.appendChild(overlay.msgEl);
      overlay.msgEl.style.margin = '20px';
      overlay.update = function(msg) {
        this.msgEl.textContent = msg;
      }
      overlay.visible = true;

      var promise =
          tr.b.Task.RunWhenIdle(this.createImportTracesTask(overlay, traces));
      promise.then(
          function() { overlay.visible = false; },
          function(err) { overlay.visible = false; }
      );
      return promise;
    }
function ( traces ) { if ( tr . isHeadless ) throw new Error ( 'Cannot use this method in headless mode.' ) ; var overlay = tr . ui . b . Overlay ( ) ; overlay . title = 'Importing...' ; overlay . userCanClose = false ; overlay . msgEl = document . createElement ( 'div' ) ; overlay . appendChild ( overlay . msgEl ) ; overlay . msgEl . style . margin = '20px' ; overlay . update = function ( msg ) { this . msgEl . textContent = msg ; } overlay . visible = true ; var promise = tr . b . Task . RunWhenIdle ( this . createImportTracesTask ( overlay , traces ) ) ; promise . then ( function ( ) { overlay . visible = false ; } , function ( err ) { overlay . visible = false ; } ) ; return promise ; }
Imports a trace with the usual options from importTraces, but
does so using idle callbacks, putting up an import dialog
during the import process.
Imports a trace with the usual options from importTraces but does so using idle callbacks putting up an import dialog during the import process .