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

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

Issue 404953004: DevTools: Refactor linkifyRawLocation to use fallback url (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address aandrey's comments #2 Created 6 years, 4 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this); 57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this);
58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this); 58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this);
59 59
60 this.enableDebugger(); 60 this.enableDebugger();
61 61
62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this); 62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this);
63 this._applySkipStackFrameSettings(); 63 this._applySkipStackFrameSettings();
64 } 64 }
65 65
66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: str ing, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ 66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */
67 WebInspector.DebuggerModel.FunctionDetails; 67 WebInspector.DebuggerModel.FunctionDetails;
68 68
69 /** 69 /**
70 * Keep these in sync with WebCore::ScriptDebugServer 70 * Keep these in sync with WebCore::ScriptDebugServer
71 * 71 *
72 * @enum {string} 72 * @enum {string}
73 */ 73 */
74 WebInspector.DebuggerModel.PauseOnExceptionsState = { 74 WebInspector.DebuggerModel.PauseOnExceptionsState = {
75 DontPauseOnExceptions : "none", 75 DontPauseOnExceptions : "none",
76 PauseOnAllExceptions : "all", 76 PauseOnAllExceptions : "all",
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 continue; 543 continue;
544 if (script.endLine < lineNumber || (script.endLine === lineNumber && script.endColumn <= columnNumber)) 544 if (script.endLine < lineNumber || (script.endLine === lineNumber && script.endColumn <= columnNumber))
545 continue; 545 continue;
546 closestScript = script; 546 closestScript = script;
547 break; 547 break;
548 } 548 }
549 return closestScript ? new WebInspector.DebuggerModel.Location(this.targ et(), closestScript.scriptId, lineNumber, columnNumber) : null; 549 return closestScript ? new WebInspector.DebuggerModel.Location(this.targ et(), closestScript.scriptId, lineNumber, columnNumber) : null;
550 }, 550 },
551 551
552 /** 552 /**
553 * @param {!DebuggerAgent.ScriptId} scriptId 553 * @param {?DebuggerAgent.ScriptId} scriptId
554 * @param {string} sourceUrl 554 * @param {string} sourceUrl
555 * @param {number} lineNumber 555 * @param {number} lineNumber
556 * @param {number} columnNumber 556 * @param {number} columnNumber
557 * @return {?WebInspector.DebuggerModel.Location} 557 * @return {?WebInspector.DebuggerModel.Location}
558 */ 558 */
559 createRawLocationByScriptId: function(scriptId, sourceUrl, lineNumber, colum nNumber) 559 createRawLocationByScriptId: function(scriptId, sourceUrl, lineNumber, colum nNumber)
560 { 560 {
561 var script = this.scriptForId(scriptId); 561 var script = scriptId ? this.scriptForId(scriptId) : null;
562 return script ? this.createRawLocation(script, lineNumber, columnNumber) : this.createRawLocationByURL(sourceUrl, lineNumber, columnNumber); 562 return script ? this.createRawLocation(script, lineNumber, columnNumber) : this.createRawLocationByURL(sourceUrl, lineNumber, columnNumber);
563 }, 563 },
564 564
565 /** 565 /**
566 * @param {!ConsoleAgent.CallFrame} callFrame
567 * @return {!WebInspector.DebuggerModel.Location}
568 */
569 createRawLocationByConsoleCallFrame: function(callFrame)
570 {
571 // FIXME(62725): console stack trace line/column numbers are one-based.
572 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0;
573 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0;
574 return new WebInspector.DebuggerModel.Location(this.target(), callFrame. scriptId, lineNumber, columnNumber);
575 },
576
577 /**
578 * @return {boolean} 566 * @return {boolean}
579 */ 567 */
580 isPaused: function() 568 isPaused: function()
581 { 569 {
582 return !!this.debuggerPausedDetails(); 570 return !!this.debuggerPausedDetails();
583 }, 571 },
584 572
585 /** 573 /**
586 * @return {boolean} 574 * @return {boolean}
587 */ 575 */
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 function didGetDetails(error, response) 721 function didGetDetails(error, response)
734 { 722 {
735 if (error) { 723 if (error) {
736 console.error(error); 724 console.error(error);
737 callback(null); 725 callback(null);
738 return; 726 return;
739 } 727 }
740 var location = response.location; 728 var location = response.location;
741 var script = this.scriptForId(location.scriptId); 729 var script = this.scriptForId(location.scriptId);
742 var rawLocation = script ? this.createRawLocation(script, location.l ineNumber + 1, location.columnNumber + 1) : null; 730 var rawLocation = script ? this.createRawLocation(script, location.l ineNumber + 1, location.columnNumber + 1) : null;
743 callback({location: rawLocation, functionName: response.functionName , scopeChain: response.scopeChain || null}); 731 var sourceURL = script ? script.contentURL() : null;
732 callback({location: rawLocation, sourceURL: sourceURL, functionName: response.functionName, scopeChain: response.scopeChain || null});
744 } 733 }
745 }, 734 },
746 735
747 /** 736 /**
748 * @param {!DebuggerAgent.BreakpointId} breakpointId 737 * @param {!DebuggerAgent.BreakpointId} breakpointId
749 * @param {function(!WebInspector.Event)} listener 738 * @param {function(!WebInspector.Event)} listener
750 * @param {!Object=} thisObject 739 * @param {!Object=} thisObject
751 */ 740 */
752 addBreakpointListener: function(breakpointId, listener, thisObject) 741 addBreakpointListener: function(breakpointId, listener, thisObject)
753 { 742 {
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 this.asyncStackTrace.dispose(); 1184 this.asyncStackTrace.dispose();
1196 }, 1185 },
1197 1186
1198 __proto__: WebInspector.SDKObject.prototype 1187 __proto__: WebInspector.SDKObject.prototype
1199 } 1188 }
1200 1189
1201 /** 1190 /**
1202 * @type {!WebInspector.DebuggerModel} 1191 * @type {!WebInspector.DebuggerModel}
1203 */ 1192 */
1204 WebInspector.debuggerModel; 1193 WebInspector.debuggerModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/DOMModel.js ('k') | Source/devtools/front_end/sdk/InspectorBackend.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698