Index: third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js |
index 4b652c7e07ce2b40242ca14db9703cbb17b4aa56..9f9e94142da6e1b95dad1c52448f83e1d99c4eeb 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js |
@@ -132,6 +132,9 @@ SDK.SourceMapManager = class extends SDK.SDKObject { |
if (!this._isEnabled) |
return; |
+ this.dispatchEventToListeners( |
+ SDK.SourceMapManager.Events.SourceMapWillAttach, {client: client, sourceMapURL: sourceMapURL}); |
+ |
if (this._sourceMapByURL.has(sourceMapURL)) { |
attach.call(this, sourceMapURL, client); |
return; |
@@ -170,8 +173,15 @@ SDK.SourceMapManager = class extends SDK.SDKObject { |
this._sourceMapLoadedForTest(); |
var clients = this._sourceMapURLToLoadingClients.get(sourceMapURL); |
this._sourceMapURLToLoadingClients.removeAll(sourceMapURL); |
- if (!sourceMap || !clients.size) |
+ if (!clients.size) |
+ return; |
+ if (!sourceMap) { |
+ for (var client of clients) { |
+ this.dispatchEventToListeners( |
+ SDK.SourceMapManager.Events.SourceMapFailedToAttach, {client: client, sourceMapURL: sourceMapURL}); |
+ } |
return; |
+ } |
this._sourceMapByURL.set(sourceMapURL, sourceMap); |
for (var client of clients) |
attach.call(this, sourceMapURL, client); |
@@ -218,7 +228,10 @@ SDK.SourceMapManager = class extends SDK.SDKObject { |
if (!sourceMapURL) |
return; |
if (!this._sourceMapURLToClients.hasValue(sourceMapURL, client)) { |
- this._sourceMapURLToLoadingClients.remove(sourceMapURL, client); |
+ if (this._sourceMapURLToLoadingClients.remove(sourceMapURL, client)) { |
+ this.dispatchEventToListeners( |
+ SDK.SourceMapManager.Events.SourceMapFailedToAttach, {client: client, sourceMapURL: sourceMapURL}); |
+ } |
return; |
} |
this._sourceMapURLToClients.remove(sourceMapURL, client); |
@@ -239,6 +252,8 @@ SDK.SourceMapManager = class extends SDK.SDKObject { |
}; |
SDK.SourceMapManager.Events = { |
+ SourceMapWillAttach: Symbol('SourceMapWillAttach'), |
+ SourceMapFailedToAttach: Symbol('SourceMapFailedToAttach'), |
SourceMapAttached: Symbol('SourceMapAttached'), |
SourceMapDetached: Symbol('SourceMapDetached'), |
SourceMapChanged: Symbol('SourceMapChanged') |