Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| index 98b2d78418741c7e2a719acad3ae717150c86fd7..2678f41c3ce0d2ed84cf2093245498434967e56c 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| @@ -590,19 +590,19 @@ WebInspector.DebuggerModel.prototype = { |
| * @param {number} endLine |
| * @param {number} endColumn |
| * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| - * @param {string} hash |
| * @param {boolean} isContentScript |
| * @param {boolean} isInternalScript |
| * @param {boolean} isLiveEdit |
| + * @param {string=} hash |
| * @param {string=} sourceMapURL |
| * @param {boolean=} hasSourceURL |
| * @param {boolean=} deprecatedCommentWasUsed |
| * @param {boolean=} hasSyntaxError |
| * @return {!WebInspector.Script} |
| */ |
| - _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, hasSyntaxError) |
| + _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, isContentScript, isInternalScript, isLiveEdit, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, hasSyntaxError) |
| { |
| - var script = new WebInspector.Script(this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveEdit, sourceMapURL, hasSourceURL); |
| + var script = new WebInspector.Script(this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, isContentScript, isInternalScript, isLiveEdit, hash, sourceMapURL, hasSourceURL); |
| this._registerScript(script); |
| if (!hasSyntaxError) |
| this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script); |
| @@ -637,6 +637,61 @@ WebInspector.DebuggerModel.prototype = { |
| }, |
| /** |
| + * @param {!Array<!DebuggerAgent.BlackboxPattern>} patterns |
| + * @return {!Promise<boolean>} |
| + */ |
| + addBlackboxPatterns: function(patterns) |
| + { |
| + return new Promise(addBlackboxPatterns.bind(this)); |
|
dgozman
2016/03/08 18:48:12
Let's use lushnikov's wisdom:
var promiseCallback
|
| + |
| + /** |
| + * @param {function(?)} fulfill |
| + * @param {function(*)} reject |
| + * @this {WebInspector.DebuggerModel} |
| + */ |
| + function addBlackboxPatterns(fulfill, reject) |
| + { |
| + this._agent.addBlackboxPatterns(patterns, callback); |
| + /** |
| + * @param {?Protocol.Error} error |
| + */ |
| + function callback(error) |
| + { |
| + if (error) |
| + console.error(error); |
| + fulfill(!error); |
| + } |
| + } |
| + }, |
| + |
| + /** |
| + * @return {!Promise<boolean>} |
| + */ |
| + clearBlackboxPatterns: function() |
| + { |
| + return new Promise(clearBlackboxPatterns.bind(this)); |
| + |
| + /** |
| + * @param {function(?)} fulfill |
| + * @param {function(*)} reject |
| + * @this {WebInspector.DebuggerModel} |
| + */ |
| + function clearBlackboxPatterns(fulfill, reject) |
| + { |
| + this._agent.clearBlackboxPatterns(callback); |
| + /** |
| + * @param {?Protocol.Error} error |
| + */ |
| + function callback(error) |
| + { |
| + if (error) |
| + console.error(error); |
| + fulfill(!error); |
| + } |
| + } |
| + }, |
| + |
| + /** |
| * @param {!WebInspector.Script} script |
| * @param {number} lineNumber |
| * @param {number} columnNumber |
| @@ -987,17 +1042,17 @@ WebInspector.DebuggerDispatcher.prototype = { |
| * @param {number} endLine |
| * @param {number} endColumn |
| * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| - * @param {string} hash |
| * @param {boolean=} isContentScript |
| * @param {boolean=} isInternalScript |
| * @param {boolean=} isLiveEdit |
| + * @param {string=} hash |
| * @param {string=} sourceMapURL |
| * @param {boolean=} hasSourceURL |
| * @param {boolean=} deprecatedCommentWasUsed |
| */ |
| - scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) |
| + scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, isContentScript, isInternalScript, isLiveEdit, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) |
| { |
| - this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, !!isContentScript, !!isInternalScript, !!isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, false); |
| + this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, !!isContentScript, !!isInternalScript, !!isLiveEdit, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, false); |
| }, |
| /** |
| @@ -1009,16 +1064,16 @@ WebInspector.DebuggerDispatcher.prototype = { |
| * @param {number} endLine |
| * @param {number} endColumn |
| * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| - * @param {string} hash |
| * @param {boolean=} isContentScript |
| * @param {boolean=} isInternalScript |
| + * @param {string=} hash |
| * @param {string=} sourceMapURL |
| * @param {boolean=} hasSourceURL |
| * @param {boolean=} deprecatedCommentWasUsed |
| */ |
| - scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) |
| + scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, isContentScript, isInternalScript, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) |
| { |
| - this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, !!isContentScript, !!isInternalScript, false, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, true); |
| + this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, !!isContentScript, !!isInternalScript, false, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, true); |
| }, |
| /** |