Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding | 7 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding |
| 8 * @param {!WebInspector.NetworkMapping} networkMapping | 8 * @param {!WebInspector.NetworkMapping} networkMapping |
| 9 */ | 9 */ |
| 10 WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping ) | 10 WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping ) |
| 11 { | 11 { |
| 12 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; | 12 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; |
| 13 this._networkMapping = networkMapping; | 13 this._networkMapping = networkMapping; |
| 14 | 14 |
| 15 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this ); | 15 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this ); |
| 16 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, th is); | 16 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, th is); |
| 17 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this. _patternChanged.bind(this)); | 17 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this. _patternChanged.bind(this)); |
| 18 WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._pat ternChanged.bind(this)); | 18 WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._pat ternChanged.bind(this)); |
| 19 | 19 |
| 20 /** @type {!Map<string, !Array<!DebuggerAgent.ScriptPosition>>} */ | 20 /** @type {!Map<string, !Array<!DebuggerAgent.ScriptPosition>>} */ |
| 21 this._scriptIdToPositions = new Map(); | 21 this._scriptIdToPositions = new Map(); |
| 22 /** @type {!Map<string, boolean>} */ | 22 /** @type {!Map<string, boolean>} */ |
| 23 this._isBlackboxedURLCache = new Map(); | 23 this._isBlackboxedURLCache = new Map(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 WebInspector.BlackboxManager.prototype = { | 26 WebInspector.BlackboxManager.prototype = { |
| 27 | |
| 28 /** | 27 /** |
| 29 * @param {function(!WebInspector.Event)} listener | 28 * @param {function(!WebInspector.Event)} listener |
| 30 * @param {!Object=} thisObject | 29 * @param {!Object=} thisObject |
| 31 */ | 30 */ |
| 32 addChangeListener: function(listener, thisObject) | 31 addChangeListener: function(listener, thisObject) |
| 33 { | 32 { |
| 34 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(l istener, thisObject); | 33 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(l istener, thisObject); |
| 35 }, | 34 }, |
| 36 | 35 |
| 37 /** | 36 /** |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 } | 302 } |
| 304 | 303 |
| 305 return script.setBlackboxedRanges(positions).then(updateState.bind(this) ); | 304 return script.setBlackboxedRanges(positions).then(updateState.bind(this) ); |
| 306 | 305 |
| 307 /** | 306 /** |
| 308 * @param {boolean} success | 307 * @param {boolean} success |
| 309 * @this {WebInspector.BlackboxManager} | 308 * @this {WebInspector.BlackboxManager} |
| 310 */ | 309 */ |
| 311 function updateState(success) | 310 function updateState(success) |
| 312 { | 311 { |
| 313 if (success) | 312 if (success) { |
| 314 this._scriptIdToPositions.set(script.scriptId, positions); | 313 this._scriptIdToPositions.set(script.scriptId, positions); |
| 315 else if (!this._scriptIdToPositions.has(script.scriptId)) | 314 this._debuggerWorkspaceBinding.updateLocations(script); |
| 315 } else if (!this._scriptIdToPositions.has(script.scriptId)) | |
|
dgozman
2016/02/18 02:17:53
nit: {} for both branches please
kozy
2016/02/18 02:36:25
Done.
| |
| 316 this._scriptIdToPositions.set(script.scriptId, []); | 316 this._scriptIdToPositions.set(script.scriptId, []); |
| 317 } | 317 } |
| 318 }, | 318 }, |
| 319 | 319 |
| 320 /** | 320 /** |
| 321 * @param {string} url | 321 * @param {string} url |
| 322 * @return {string} | 322 * @return {string} |
| 323 */ | 323 */ |
| 324 _urlToRegExpString: function(url) | 324 _urlToRegExpString: function(url) |
| 325 { | 325 { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 344 if (scheme === "chrome-extension") | 344 if (scheme === "chrome-extension") |
| 345 prefix += parsedURL.host + "\\b"; | 345 prefix += parsedURL.host + "\\b"; |
| 346 prefix += ".*"; | 346 prefix += ".*"; |
| 347 } | 347 } |
| 348 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b"); | 348 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b"); |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 /** @type {!WebInspector.BlackboxManager} */ | 352 /** @type {!WebInspector.BlackboxManager} */ |
| 353 WebInspector.blackboxManager; | 353 WebInspector.blackboxManager; |
| OLD | NEW |