import{TimelineLoader}from"./TimelineLoader.js";export class ExtensionTracingSession{constructor(e,i){this._provider=e,this._performanceModel=i,this._completionCallback,this._completionPromise=new Promise((e=>{this._completionCallback=e})),this._timeOffset=0}loadingStarted(){}processingStarted(){}loadingProgress(e){}loadingComplete(e){e&&(this._performanceModel.addExtensionEvents(this._provider.longDisplayName(),e,this._timeOffset),this._completionCallback())}complete(e,i){e?(this._timeOffset=i,TimelineLoader.loadFromURL(e,this)):this._completionCallback()}start(){this._provider.start(this)}stop(){return this._provider.stop(),this._completionPromise}}