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

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

Issue 2784413003: DevTools: carefully cleanup javascript sourcemaps (Closed)
Patch Set: 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
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..ae172d0940f52ad1e9b9772f1930d385bfd13dc2 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,9 @@ SDK.SourceMapManager = class extends SDK.SDKObject {
if (!this._isEnabled)
return;
+ this.dispatchEventToListeners(
+ SDK.SourceMapManager.Events.SourceMapWillAttach, {client: client, sourceMapURL: sourceMapURL});
dgozman 2017/03/31 21:57:41 drop sourceMapURL
lushnikov 2017/03/31 23:53:10 Done.
+
if (this._sourceMapByURL.has(sourceMapURL)) {
attach.call(this, sourceMapURL, client);
return;
@@ -169,8 +172,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});
dgozman 2017/03/31 21:57:41 drop sourceMapURL
lushnikov 2017/03/31 23:53:10 Done.
+ }
return;
+ }
this._sourceMapByURL.set(sourceMapURL, sourceMap);
for (var client of clients)
attach.call(this, sourceMapURL, client);
@@ -217,7 +227,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});
dgozman 2017/03/31 21:57:41 drop sourceMapURL
lushnikov 2017/03/31 23:53:10 Done.
+ }
return;
}
this._sourceMapURLToClients.remove(sourceMapURL, client);
@@ -238,6 +251,8 @@ SDK.SourceMapManager = class extends SDK.SDKObject {
};
SDK.SourceMapManager.Events = {
+ SourceMapWillAttach: Symbol('SourceMapWillAttach'),
dgozman 2017/03/31 21:57:41 SourceMapWillBeAttached
lushnikov 2017/03/31 23:53:10 Decided to keep this as-is: renamed event looked l
+ SourceMapFailedToAttach: Symbol('SourceMapFailedToAttach'),
SourceMapAttached: Symbol('SourceMapAttached'),
SourceMapDetached: Symbol('SourceMapDetached'),
SourceMapChanged: Symbol('SourceMapChanged')

Powered by Google App Engine
This is Rietveld 408576698