lib/third_party/tracing/base/task.js
function() {
      if (this.runCb_ !== undefined)
        this.runCb_.call(this.thisArg_, this);
      var subTasks = this.subTasks_;
      this.subTasks_ = undefined; // Prevent more subTasks from being posted.

      if (!subTasks.length)
        return this.afterTask_;

      // If there are subtasks, then we want to execute all the subtasks and
      // then this task's afterTask. To make this happen, we update the
      // afterTask of all the subtasks so the point upward to each other, e.g.
      // subTask[0].afterTask to subTask[1] and so on. Then, the last subTask's
      // afterTask points at this task's afterTask.
      for (var i = 1; i < subTasks.length; i++)
        subTasks[i - 1].afterTask_ = subTasks[i];
      subTasks[subTasks.length - 1].afterTask_ = this.afterTask_;
      return subTasks[0];
    }
function() {
      if (this.runCb_ !== undefined)
        this.runCb_.call(this.thisArg_, this);
      var subTasks = this.subTasks_;
      this.subTasks_ = undefined; // Prevent more subTasks from being posted.

      if (!subTasks.length)
        return this.afterTask_;

      // If there are subtasks, then we want to execute all the subtasks and
      // then this task's afterTask. To make this happen, we update the
      // afterTask of all the subtasks so the point upward to each other, e.g.
      // subTask[0].afterTask to subTask[1] and so on. Then, the last subTask's
      // afterTask points at this task's afterTask.
      for (var i = 1; i < subTasks.length; i++)
        subTasks[i - 1].afterTask_ = subTasks[i];
      subTasks[subTasks.length - 1].afterTask_ = this.afterTask_;
      return subTasks[0];
    }
function ( ) { if ( this . runCb_ !== undefined ) this . runCb_ . call ( this . thisArg_ , this ) ; var subTasks = this . subTasks_ ; this . subTasks_ = undefined ; // Prevent more subTasks from being posted. if ( ! subTasks . length ) return this . afterTask_ ; // If there are subtasks, then we want to execute all the subtasks and // then this task's afterTask. To make this happen, we update the // afterTask of all the subtasks so the point upward to each other, e.g. // subTask[0].afterTask to subTask[1] and so on. Then, the last subTask's // afterTask points at this task's afterTask. for ( var i = 1 ; i < subTasks . length ; i ++ ) subTasks [ i - 1 ] . afterTask_ = subTasks [ i ] ; subTasks [ subTasks . length - 1 ] . afterTask_ = this . afterTask_ ; return subTasks [ 0 ] ; }
Runs the current task and returns the task that should be executed next.
Runs the current task and returns the task that should be executed next .