Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js

Issue 2784413003: DevTools: carefully cleanup javascript sourcemaps (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/Script.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54c978fac300999a2734dfaa54e1694401b08f45..5a29b7e15b752df189a19294a44cfba4587526f2 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js
@@ -131,6 +131,8 @@ SDK.SourceMapManager = class extends SDK.SDKObject {
if (!this._isEnabled)
return;
+ this.dispatchEventToListeners(SDK.SourceMapManager.Events.SourceMapWillAttach, client);
+
if (this._sourceMapByURL.has(sourceMapURL)) {
attach.call(this, sourceMapURL, client);
return;
@@ -169,8 +171,13 @@ 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);
return;
+ }
this._sourceMapByURL.set(sourceMapURL, sourceMap);
for (var client of clients)
attach.call(this, sourceMapURL, client);
@@ -217,7 +224,8 @@ 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);
return;
}
this._sourceMapURLToClients.remove(sourceMapURL, client);
@@ -238,6 +246,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')
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/Script.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698