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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 1699183003: [DevTools] Don't load sourcemap for blackboxed scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return; 155 return;
156 } 156 }
157 157
158 if (this._blackboxInfobar) 158 if (this._blackboxInfobar)
159 this._blackboxInfobar.dispose(); 159 this._blackboxInfobar.dispose();
160 160
161 var infobar = new WebInspector.Infobar(WebInspector.Infobar.Type.Warning , WebInspector.UIString("This script is blackboxed in debugger")); 161 var infobar = new WebInspector.Infobar(WebInspector.Infobar.Type.Warning , WebInspector.UIString("This script is blackboxed in debugger"));
162 this._blackboxInfobar = infobar; 162 this._blackboxInfobar = infobar;
163 163
164 infobar.createDetailsRowMessage(WebInspector.UIString("Debugger will ski p stepping through this script, and will not stop on exceptions")); 164 infobar.createDetailsRowMessage(WebInspector.UIString("Debugger will ski p stepping through this script, and will not stop on exceptions"));
165
166 var scriptFile = this._scriptFileForTarget.valuesArray()[0];
167 if (scriptFile.hasSourceMapURL())
168 infobar.createDetailsRowMessage(WebInspector.UIString("SourceMap wil l be ignored for this file."));
paulirish 2016/02/22 18:47:41 "Source map found, but ignored for blackboxed file
165 infobar.createDetailsRowMessage(); 169 infobar.createDetailsRowMessage();
166 infobar.createDetailsRowMessage(WebInspector.UIString("Possible ways to cancel this behavior are:")); 170 infobar.createDetailsRowMessage(WebInspector.UIString("Possible ways to cancel this behavior are:"));
167 171
168 infobar.createDetailsRowMessage(" - ").createTextChild(WebInspector.UISt ring("Go to \"%s\" tab in settings", WebInspector.manageBlackboxingSettingsTabLa bel())); 172 infobar.createDetailsRowMessage(" - ").createTextChild(WebInspector.UISt ring("Go to \"%s\" tab in settings", WebInspector.manageBlackboxingSettingsTabLa bel()));
169 var unblackboxLink = infobar.createDetailsRowMessage(" - ").createChild( "span", "link"); 173 var unblackboxLink = infobar.createDetailsRowMessage(" - ").createChild( "span", "link");
170 unblackboxLink.textContent = WebInspector.UIString("Unblackbox this scri pt"); 174 unblackboxLink.textContent = WebInspector.UIString("Unblackbox this scri pt");
171 unblackboxLink.addEventListener("click", unblackbox, false); 175 unblackboxLink.addEventListener("click", unblackbox, false);
172 176
173 function unblackbox() 177 function unblackbox()
174 { 178 {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 345 }
342 346
343 /** 347 /**
344 * @this {WebInspector.JavaScriptSourceFrame} 348 * @this {WebInspector.JavaScriptSourceFrame}
345 */ 349 */
346 function populateSourceMapMembers() 350 function populateSourceMapMembers()
347 { 351 {
348 if (this.uiSourceCode().project().type() === WebInspector.projectTyp es.Network && WebInspector.moduleSetting("jsSourceMapsEnabled").get()) { 352 if (this.uiSourceCode().project().type() === WebInspector.projectTyp es.Network && WebInspector.moduleSetting("jsSourceMapsEnabled").get()) {
349 if (this._scriptFileForTarget.size) { 353 if (this._scriptFileForTarget.size) {
350 var scriptFile = this._scriptFileForTarget.valuesArray()[0]; 354 var scriptFile = this._scriptFileForTarget.valuesArray()[0];
355 if (scriptFile.isBlackboxed())
356 return;
351 var addSourceMapURLLabel = WebInspector.UIString.capitalize( "Add ^source ^map\u2026"); 357 var addSourceMapURLLabel = WebInspector.UIString.capitalize( "Add ^source ^map\u2026");
352 contextMenu.appendItem(addSourceMapURLLabel, addSourceMapURL .bind(null, scriptFile)); 358 contextMenu.appendItem(addSourceMapURLLabel, addSourceMapURL .bind(null, scriptFile));
353 contextMenu.appendSeparator(); 359 contextMenu.appendSeparator();
354 } 360 }
355 } 361 }
356 } 362 }
357 363
358 return WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextM enu.call(this, contextMenu, lineNumber, columnNumber).then(populateSourceMapMemb ers.bind(this)); 364 return WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextM enu.call(this, contextMenu, lineNumber, columnNumber).then(populateSourceMapMemb ers.bind(this));
359 }, 365 },
360 366
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this); 1118 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this);
1113 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this); 1119 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this);
1114 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this); 1120 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this);
1115 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this); 1121 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this);
1116 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this); 1122 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this);
1117 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 1123 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
1118 }, 1124 },
1119 1125
1120 __proto__: WebInspector.UISourceCodeFrame.prototype 1126 __proto__: WebInspector.UISourceCodeFrame.prototype
1121 } 1127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698