 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 this._executionContextId = executionContextId; | 54 this._executionContextId = executionContextId; | 
| 55 this._isContentScript = isContentScript; | 55 this._isContentScript = isContentScript; | 
| 56 this._isInternalScript = isInternalScript; | 56 this._isInternalScript = isInternalScript; | 
| 57 this._isLiveEdit = isLiveEdit; | 57 this._isLiveEdit = isLiveEdit; | 
| 58 this.sourceMapURL = sourceMapURL; | 58 this.sourceMapURL = sourceMapURL; | 
| 59 this.hasSourceURL = hasSourceURL; | 59 this.hasSourceURL = hasSourceURL; | 
| 60 } | 60 } | 
| 61 | 61 | 
| 62 WebInspector.Script.Events = { | 62 WebInspector.Script.Events = { | 
| 63 ScriptEdited: "ScriptEdited", | 63 ScriptEdited: "ScriptEdited", | 
| 64 SourceMapURLAdded: "SourceMapURLAdded", | 64 SourceMapURLAdded: "SourceMapURLAdded" | 
| 65 } | 65 } | 
| 66 | 66 | 
| 67 WebInspector.Script.sourceURLRegex = /^[\040\t]*\/\/# sourceURL=\s*(\S*?)\s*$/m; | 67 WebInspector.Script.sourceURLRegex = /^[\040\t]*\/\/# sourceURL=\s*(\S*?)\s*$/m; | 
| 68 | 68 | 
| 69 /** | 69 /** | 
| 70 * @param {string} source | 70 * @param {string} source | 
| 71 * @return {string} | 71 * @return {string} | 
| 72 */ | 72 */ | 
| 73 WebInspector.Script._trimSourceURLComment = function(source) | 73 WebInspector.Script._trimSourceURLComment = function(source) | 
| 74 { | 74 { | 
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 /** | 284 /** | 
| 285 * @return {boolean} | 285 * @return {boolean} | 
| 286 */ | 286 */ | 
| 287 isInlineScriptWithSourceURL: function() | 287 isInlineScriptWithSourceURL: function() | 
| 288 { | 288 { | 
| 289 return !!this.hasSourceURL && this.isInlineScript(); | 289 return !!this.hasSourceURL && this.isInlineScript(); | 
| 290 }, | 290 }, | 
| 291 | 291 | 
| 292 /** | 292 /** | 
| 293 * @param {!Array<!DebuggerAgent.ScriptPosition>} positions | 293 * @param {!Array<!DebuggerAgent.ScriptPosition>} positions | 
| 294 * @return {!Promise<undefined>} | |
| 294 */ | 295 */ | 
| 295 setBlackboxedRanges: function(positions) | 296 setBlackboxedRanges: function(positions) | 
| 296 { | 297 { | 
| 297 this.target().debuggerAgent().setBlackboxedRanges(this.scriptId, positio ns); | 298 return new Promise(setBlackboxedRanges.bind(this)); | 
| 299 | |
| 300 /** | |
| 301 * @param {function(?)} fulfill | |
| 302 * @param {function(*)} reject | |
| 303 * @this {WebInspector.Script} | |
| 304 */ | |
| 305 function setBlackboxedRanges(fulfill, reject) | |
| 306 { | |
| 307 this.target().debuggerAgent().setBlackboxedRanges(this.scriptId, pos itions, callback); | |
| 308 /** | |
| 309 * @param {?Protocol.Error} error | |
| 310 */ | |
| 311 function callback(error) | |
| 312 { | |
| 313 if (error) | |
| 314 reject(error); | |
| 
dgozman
2016/02/09 23:44:51
console.error(error)
 
kozy
2016/02/10 01:19:42
Done.
 | |
| 315 fulfill(error); | |
| 
dgozman
2016/02/09 23:44:51
fullfill();
 
kozy
2016/02/10 01:19:41
Done.
 | |
| 316 } | |
| 317 } | |
| 298 }, | 318 }, | 
| 299 | 319 | 
| 300 __proto__: WebInspector.SDKObject.prototype | 320 __proto__: WebInspector.SDKObject.prototype | 
| 301 } | 321 } | 
| OLD | NEW |