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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 1754483002: [DevTools] Added setBlackboxPatterns method to protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@provide-hash-for-anonymous-scripts
Patch Set: Created 4 years, 9 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 }, 583 },
584 584
585 /** 585 /**
586 * @param {!RuntimeAgent.ScriptId} scriptId 586 * @param {!RuntimeAgent.ScriptId} scriptId
587 * @param {string} sourceURL 587 * @param {string} sourceURL
588 * @param {number} startLine 588 * @param {number} startLine
589 * @param {number} startColumn 589 * @param {number} startColumn
590 * @param {number} endLine 590 * @param {number} endLine
591 * @param {number} endColumn 591 * @param {number} endColumn
592 * @param {!RuntimeAgent.ExecutionContextId} executionContextId 592 * @param {!RuntimeAgent.ExecutionContextId} executionContextId
593 * @param {string} hash
594 * @param {boolean} isContentScript 593 * @param {boolean} isContentScript
595 * @param {boolean} isInternalScript 594 * @param {boolean} isInternalScript
596 * @param {boolean} isLiveEdit 595 * @param {boolean} isLiveEdit
596 * @param {string=} hash
597 * @param {string=} sourceMapURL 597 * @param {string=} sourceMapURL
598 * @param {boolean=} hasSourceURL 598 * @param {boolean=} hasSourceURL
599 * @param {boolean=} deprecatedCommentWasUsed 599 * @param {boolean=} deprecatedCommentWasUsed
600 * @param {boolean=} hasSyntaxError 600 * @param {boolean=} hasSyntaxError
601 * @return {!WebInspector.Script} 601 * @return {!WebInspector.Script}
602 */ 602 */
603 _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, e ndLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, hasSyntaxError ) 603 _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, e ndLine, endColumn, executionContextId, isContentScript, isInternalScript, isLive Edit, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, hasSyntaxError )
604 { 604 {
605 var script = new WebInspector.Script(this, scriptId, sourceURL, startLin e, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, i sInternalScript, isLiveEdit, sourceMapURL, hasSourceURL); 605 var script = new WebInspector.Script(this, scriptId, sourceURL, startLin e, startColumn, endLine, endColumn, executionContextId, isContentScript, isInter nalScript, isLiveEdit, hash, sourceMapURL, hasSourceURL);
606 this._registerScript(script); 606 this._registerScript(script);
607 if (!hasSyntaxError) 607 if (!hasSyntaxError)
608 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Pars edScriptSource, script); 608 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Pars edScriptSource, script);
609 else 609 else
610 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Fail edToParseScriptSource, script); 610 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Fail edToParseScriptSource, script);
611 611
612 if (deprecatedCommentWasUsed) { 612 if (deprecatedCommentWasUsed) {
613 var text = WebInspector.UIString("'//@ sourceURL' and '//@ sourceMap pingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead."); 613 var text = WebInspector.UIString("'//@ sourceURL' and '//@ sourceMap pingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead.");
614 var msg = new WebInspector.ConsoleMessage(this.target(), WebInspecto r.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Warn ing, text, undefined, undefined, undefined, undefined, undefined, undefined, und efined, undefined, undefined, scriptId); 614 var msg = new WebInspector.ConsoleMessage(this.target(), WebInspecto r.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Warn ing, text, undefined, undefined, undefined, undefined, undefined, undefined, und efined, undefined, undefined, scriptId);
615 var consoleModel = this.target().consoleModel; 615 var consoleModel = this.target().consoleModel;
(...skipping 14 matching lines...) Expand all
630 630
631 var scripts = this._scriptsBySourceURL.get(script.sourceURL); 631 var scripts = this._scriptsBySourceURL.get(script.sourceURL);
632 if (!scripts) { 632 if (!scripts) {
633 scripts = []; 633 scripts = [];
634 this._scriptsBySourceURL.set(script.sourceURL, scripts); 634 this._scriptsBySourceURL.set(script.sourceURL, scripts);
635 } 635 }
636 scripts.push(script); 636 scripts.push(script);
637 }, 637 },
638 638
639 /** 639 /**
640 * @param {!Array<!DebuggerAgent.BlackboxPattern>} patterns
641 * @return {!Promise<boolean>}
642 */
643 addBlackboxPatterns: function(patterns)
644 {
645 return new Promise(addBlackboxPatterns.bind(this));
646
647 /**
648 * @param {function(?)} fulfill
649 * @param {function(*)} reject
650 * @this {WebInspector.DebuggerModel}
651 */
652 function addBlackboxPatterns(fulfill, reject)
653 {
654 this._agent.addBlackboxPatterns(patterns, callback);
655 /**
656 * @param {?Protocol.Error} error
657 */
658 function callback(error)
659 {
660 if (error)
661 console.error(error);
662 fulfill(!error);
663 }
664 }
665 },
666
667 /**
640 * @param {!WebInspector.Script} script 668 * @param {!WebInspector.Script} script
641 * @param {number} lineNumber 669 * @param {number} lineNumber
642 * @param {number} columnNumber 670 * @param {number} columnNumber
643 * @return {?WebInspector.DebuggerModel.Location} 671 * @return {?WebInspector.DebuggerModel.Location}
644 */ 672 */
645 createRawLocation: function(script, lineNumber, columnNumber) 673 createRawLocation: function(script, lineNumber, columnNumber)
646 { 674 {
647 if (script.sourceURL) 675 if (script.sourceURL)
648 return this.createRawLocationByURL(script.sourceURL, lineNumber, col umnNumber); 676 return this.createRawLocationByURL(script.sourceURL, lineNumber, col umnNumber);
649 return new WebInspector.DebuggerModel.Location(this, script.scriptId, li neNumber, columnNumber); 677 return new WebInspector.DebuggerModel.Location(this, script.scriptId, li neNumber, columnNumber);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 1008
981 /** 1009 /**
982 * @override 1010 * @override
983 * @param {!RuntimeAgent.ScriptId} scriptId 1011 * @param {!RuntimeAgent.ScriptId} scriptId
984 * @param {string} sourceURL 1012 * @param {string} sourceURL
985 * @param {number} startLine 1013 * @param {number} startLine
986 * @param {number} startColumn 1014 * @param {number} startColumn
987 * @param {number} endLine 1015 * @param {number} endLine
988 * @param {number} endColumn 1016 * @param {number} endColumn
989 * @param {!RuntimeAgent.ExecutionContextId} executionContextId 1017 * @param {!RuntimeAgent.ExecutionContextId} executionContextId
990 * @param {string} hash 1018 * @param {string=} hash
dgozman 2016/03/07 17:26:13 Move it down the list to align with DebuggerModel.
kozy 2016/03/08 02:33:20 Done.
991 * @param {boolean=} isContentScript 1019 * @param {boolean=} isContentScript
992 * @param {boolean=} isInternalScript 1020 * @param {boolean=} isInternalScript
993 * @param {boolean=} isLiveEdit 1021 * @param {boolean=} isLiveEdit
994 * @param {string=} sourceMapURL 1022 * @param {string=} sourceMapURL
995 * @param {boolean=} hasSourceURL 1023 * @param {boolean=} hasSourceURL
996 * @param {boolean=} deprecatedCommentWasUsed 1024 * @param {boolean=} deprecatedCommentWasUsed
997 */ 1025 */
998 scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveE dit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) 1026 scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveE dit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed)
999 { 1027 {
1000 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, !!isContentScript, !! isInternalScript, !!isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWas Used, false); 1028 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, !!isContentScript, !!isInte rnalScript, !!isLiveEdit, hash, sourceMapURL, hasSourceURL, deprecatedCommentWas Used, false);
1001 }, 1029 },
1002 1030
1003 /** 1031 /**
1004 * @override 1032 * @override
1005 * @param {!RuntimeAgent.ScriptId} scriptId 1033 * @param {!RuntimeAgent.ScriptId} scriptId
1006 * @param {string} sourceURL 1034 * @param {string} sourceURL
1007 * @param {number} startLine 1035 * @param {number} startLine
1008 * @param {number} startColumn 1036 * @param {number} startColumn
1009 * @param {number} endLine 1037 * @param {number} endLine
1010 * @param {number} endColumn 1038 * @param {number} endColumn
1011 * @param {!RuntimeAgent.ExecutionContextId} executionContextId 1039 * @param {!RuntimeAgent.ExecutionContextId} executionContextId
1012 * @param {string} hash 1040 * @param {string=} hash
1013 * @param {boolean=} isContentScript 1041 * @param {boolean=} isContentScript
1014 * @param {boolean=} isInternalScript 1042 * @param {boolean=} isInternalScript
1015 * @param {string=} sourceMapURL 1043 * @param {string=} sourceMapURL
1016 * @param {boolean=} hasSourceURL 1044 * @param {boolean=} hasSourceURL
1017 * @param {boolean=} deprecatedCommentWasUsed 1045 * @param {boolean=} deprecatedCommentWasUsed
1018 */ 1046 */
1019 scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, e ndLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) 1047 scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, e ndLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed)
1020 { 1048 {
1021 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, !!isContentScript, !! isInternalScript, false, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, t rue); 1049 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, !!isContentScript, !!isInte rnalScript, false, hash, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, t rue);
1022 }, 1050 },
1023 1051
1024 /** 1052 /**
1025 * @override 1053 * @override
1026 * @param {!DebuggerAgent.BreakpointId} breakpointId 1054 * @param {!DebuggerAgent.BreakpointId} breakpointId
1027 * @param {!DebuggerAgent.Location} location 1055 * @param {!DebuggerAgent.Location} location
1028 */ 1056 */
1029 breakpointResolved: function(breakpointId, location) 1057 breakpointResolved: function(breakpointId, location)
1030 { 1058 {
1031 this._debuggerModel._breakpointResolved(breakpointId, location); 1059 this._debuggerModel._breakpointResolved(breakpointId, location);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 /** 1473 /**
1446 * @param {?WebInspector.Target} target 1474 * @param {?WebInspector.Target} target
1447 * @return {?WebInspector.DebuggerModel} 1475 * @return {?WebInspector.DebuggerModel}
1448 */ 1476 */
1449 WebInspector.DebuggerModel.fromTarget = function(target) 1477 WebInspector.DebuggerModel.fromTarget = function(target)
1450 { 1478 {
1451 if (!target || !target.hasJSContext()) 1479 if (!target || !target.hasJSContext())
1452 return null; 1480 return null;
1453 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel)); 1481 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel));
1454 } 1482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698