 Chromium Code Reviews
 Chromium Code Reviews Issue 1663723002:
  [DevTools] Add sourceMap support for blackboxing  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@call-set-blackboxed-ranges-on-script-parsed
    
  
    Issue 1663723002:
  [DevTools] Add sourceMap support for blackboxing  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@call-set-blackboxed-ranges-on-script-parsed| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions | 
| 6 * are met: | 6 * are met: | 
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright | 
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. | 
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright | 
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the | 
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 this.callFrameList.addItem(asyncCallFrameItem); | 111 this.callFrameList.addItem(asyncCallFrameItem); | 
| 112 | 112 | 
| 113 var allCallFramesHidden = true; | 113 var allCallFramesHidden = true; | 
| 114 for (var i = 0, n = callFrames.length; i < n; ++i) { | 114 for (var i = 0, n = callFrames.length; i < n; ++i) { | 
| 115 var callFrame = callFrames[i]; | 115 var callFrame = callFrames[i]; | 
| 116 var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame( callFrame, asyncCallFrameItem); | 116 var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame( callFrame, asyncCallFrameItem); | 
| 117 callFrameItem.element.addEventListener("click", this._callFrameSelec ted.bind(this, callFrameItem), false); | 117 callFrameItem.element.addEventListener("click", this._callFrameSelec ted.bind(this, callFrameItem), false); | 
| 118 callFrameItem.element.addEventListener("contextmenu", this._callFram eContextMenu.bind(this, callFrameItem), true); | 118 callFrameItem.element.addEventListener("contextmenu", this._callFram eContextMenu.bind(this, callFrameItem), true); | 
| 119 this.callFrames.push(callFrameItem); | 119 this.callFrames.push(callFrameItem); | 
| 120 | 120 | 
| 121 if (WebInspector.BlackboxSupport.isBlackboxed(callFrame.script.sourc eURL, callFrame.script.isContentScript())) { | 121 if (WebInspector.blackboxManager.isBlackboxedScript(callFrame.script )) { | 
| 122 callFrameItem.setHidden(true); | 122 callFrameItem.setHidden(true); | 
| 123 callFrameItem.setDimmed(true); | 123 callFrameItem.setDimmed(true); | 
| 124 ++this._hiddenCallFrames; | 124 ++this._hiddenCallFrames; | 
| 125 } else { | 125 } else { | 
| 126 this.callFrameList.addItem(callFrameItem); | 126 this.callFrameList.addItem(callFrameItem); | 
| 127 allCallFramesHidden = false; | 127 allCallFramesHidden = false; | 
| 128 } | 128 } | 
| 129 } | 129 } | 
| 130 if (allCallFramesHidden && asyncCallFrameItem) { | 130 if (allCallFramesHidden && asyncCallFrameItem) { | 
| 131 asyncCallFrameItem.setHidden(true); | 131 asyncCallFrameItem.setHidden(true); | 
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 } | 190 } | 
| 191 }, | 191 }, | 
| 192 | 192 | 
| 193 /** | 193 /** | 
| 194 * @param {!WebInspector.ContextMenu} contextMenu | 194 * @param {!WebInspector.ContextMenu} contextMenu | 
| 195 * @param {string} url | 195 * @param {string} url | 
| 196 * @param {boolean} isContentScript | 196 * @param {boolean} isContentScript | 
| 197 */ | 197 */ | 
| 198 appendBlackboxURLContextMenuItems: function(contextMenu, url, isContentScrip t) | 198 appendBlackboxURLContextMenuItems: function(contextMenu, url, isContentScrip t) | 
| 199 { | 199 { | 
| 200 var blackboxed = WebInspector.BlackboxSupport.isBlackboxed(url, isConten tScript); | 200 var blackboxed = WebInspector.blackboxManager.isBlackboxedContentScripts () && isContentScript; | 
| 
dgozman
2016/02/09 23:44:51
Can we switch this to isUISourceCodeBlackboxed?
 
kozy
2016/02/10 01:19:42
Done.
 | |
| 201 var canBlackBox = WebInspector.BlackboxSupport.canBlackboxURL(url); | 201 if (!blackboxed) | 
| 202 blackboxed = WebInspector.blackboxManager.isBlackboxedURL(url); | |
| 203 var canBlackBox = WebInspector.blackboxManager.canBlackboxURL(url); | |
| 202 if (!blackboxed && !isContentScript && !canBlackBox) | 204 if (!blackboxed && !isContentScript && !canBlackBox) | 
| 203 return; | 205 return; | 
| 204 | 206 | 
| 205 if (blackboxed) { | 207 if (blackboxed) { | 
| 206 contextMenu.appendItem(WebInspector.UIString.capitalize("Stop ^black boxing"), this._handleContextMenuBlackboxURL.bind(this, url, isContentScript, fa lse)); | 208 contextMenu.appendItem(WebInspector.UIString.capitalize("Stop ^black boxing"), this._handleContextMenuBlackboxURL.bind(this, url, isContentScript, fa lse)); | 
| 207 } else { | 209 } else { | 
| 208 if (canBlackBox) | 210 if (canBlackBox) | 
| 209 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo x ^script"), this._handleContextMenuBlackboxURL.bind(this, url, false, true)); | 211 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo x ^script"), this._handleContextMenuBlackboxURL.bind(this, url, false, true)); | 
| 210 if (isContentScript) | 212 if (isContentScript) | 
| 211 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo x ^all ^content ^scripts"), this._handleContextMenuBlackboxURL.bind(this, url, t rue, true)); | 213 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo x ^all ^content ^scripts"), this._handleContextMenuBlackboxURL.bind(this, url, t rue, true)); | 
| 212 } | 214 } | 
| 213 }, | 215 }, | 
| 214 | 216 | 
| 215 /** | 217 /** | 
| 216 * @param {string} url | 218 * @param {string} url | 
| 217 * @param {boolean} isContentScript | 219 * @param {boolean} isContentScript | 
| 218 * @param {boolean} blackbox | 220 * @param {boolean} blackbox | 
| 219 */ | 221 */ | 
| 220 _handleContextMenuBlackboxURL: function(url, isContentScript, blackbox) | 222 _handleContextMenuBlackboxURL: function(url, isContentScript, blackbox) | 
| 221 { | 223 { | 
| 222 if (blackbox) { | 224 if (blackbox) { | 
| 223 if (isContentScript) | 225 if (isContentScript) | 
| 224 WebInspector.moduleSetting("skipContentScripts").set(true); | 226 WebInspector.moduleSetting("skipContentScripts").set(true); | 
| 225 else | 227 else | 
| 226 WebInspector.BlackboxSupport.blackboxURL(url); | 228 WebInspector.blackboxManager.blackboxURL(url); | 
| 227 } else { | 229 } else { | 
| 228 WebInspector.BlackboxSupport.unblackbox(url, isContentScript); | 230 WebInspector.blackboxManager.unblackbox(url, isContentScript); | 
| 229 } | 231 } | 
| 230 }, | 232 }, | 
| 231 | 233 | 
| 232 _blackboxingStateChanged: function() | 234 _blackboxingStateChanged: function() | 
| 233 { | 235 { | 
| 234 if (!this._debuggerModel) | 236 if (!this._debuggerModel) | 
| 235 return; | 237 return; | 
| 236 var details = this._debuggerModel.debuggerPausedDetails(); | 238 var details = this._debuggerModel.debuggerPausedDetails(); | 
| 237 if (!details) | 239 if (!details) | 
| 238 return; | 240 return; | 
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 */ | 430 */ | 
| 429 _update: function(uiLocation) | 431 _update: function(uiLocation) | 
| 430 { | 432 { | 
| 431 var text = uiLocation.linkText(); | 433 var text = uiLocation.linkText(); | 
| 432 this.setSubtitle(text.trimMiddle(30)); | 434 this.setSubtitle(text.trimMiddle(30)); | 
| 433 this.subtitleElement.title = text; | 435 this.subtitleElement.title = text; | 
| 434 }, | 436 }, | 
| 435 | 437 | 
| 436 __proto__: WebInspector.UIList.Item.prototype | 438 __proto__: WebInspector.UIList.Item.prototype | 
| 437 } | 439 } | 
| OLD | NEW |