CompilerSourceMappingContentProvider.js 968 B

12345678
  1. export class CompilerSourceMappingContentProvider{constructor(sourceURL,contentType){this._sourceURL=sourceURL;this._contentType=contentType;}
  2. contentURL(){return this._sourceURL;}
  3. contentType(){return this._contentType;}
  4. contentEncoded(){return Promise.resolve(false);}
  5. requestContent(){return new Promise(resolve=>{SDK.multitargetNetworkManager.loadResource(this._sourceURL,(statusCode,_headers,content)=>{if(statusCode>=400){const error=ls`Could not load content for ${this._sourceURL} : HTTP status code: ${statusCode}`;console.error(error);resolve({error,isEncoded:false});}else{resolve({content,isEncoded:false});}});});}
  6. async searchInContent(query,caseSensitive,isRegex){const{content}=await this.requestContent();if(typeof content!=='string'){return[];}
  7. return Common.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex);}}
  8. self.SDK=self.SDK||{};SDK=SDK||{};SDK.CompilerSourceMappingContentProvider=CompilerSourceMappingContentProvider;