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

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

Issue 2781923002: [WIP] DevTools: user SourceMapManager in Debugger (Closed)
Patch Set: works great 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 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')
« 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