Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this ._pauseOnExceptionStateChanged, this); | 55 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this ._pauseOnExceptionStateChanged, this); |
| 56 WebInspector.moduleSetting("pauseOnCaughtException").addChangeListener(this. _pauseOnExceptionStateChanged, this); | 56 WebInspector.moduleSetting("pauseOnCaughtException").addChangeListener(this. _pauseOnExceptionStateChanged, this); |
| 57 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this. asyncStackTracesStateChanged, this); | 57 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this. asyncStackTracesStateChanged, this); |
| 58 | 58 |
| 59 this.enableDebugger(); | 59 this.enableDebugger(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ | 62 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ |
| 63 WebInspector.DebuggerModel.FunctionDetails; | 63 WebInspector.DebuggerModel.FunctionDetails; |
| 64 | 64 |
| 65 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, status: string}} */ | |
| 66 WebInspector.DebuggerModel.GeneratorObjectDetails; | |
| 67 | |
| 68 /** | 65 /** |
| 69 * Keep these in sync with WebCore::V8Debugger | 66 * Keep these in sync with WebCore::V8Debugger |
| 70 * | 67 * |
| 71 * @enum {string} | 68 * @enum {string} |
| 72 */ | 69 */ |
| 73 WebInspector.DebuggerModel.PauseOnExceptionsState = { | 70 WebInspector.DebuggerModel.PauseOnExceptionsState = { |
| 74 DontPauseOnExceptions : "none", | 71 DontPauseOnExceptions : "none", |
| 75 PauseOnAllExceptions : "all", | 72 PauseOnAllExceptions : "all", |
| 76 PauseOnUncaughtExceptions: "uncaught" | 73 PauseOnUncaughtExceptions: "uncaught" |
| 77 }; | 74 }; |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 callback(error); | 708 callback(error); |
| 712 return; | 709 return; |
| 713 } | 710 } |
| 714 if (callback) | 711 if (callback) |
| 715 callback(); | 712 callback(); |
| 716 } | 713 } |
| 717 }, | 714 }, |
| 718 | 715 |
| 719 /** | 716 /** |
| 720 * @param {!WebInspector.RemoteObject} remoteObject | 717 * @param {!WebInspector.RemoteObject} remoteObject |
| 721 * @param {function(?WebInspector.DebuggerModel.GeneratorObjectDetails)} cal lback | 718 * @return {!Promise<?WebInspector.DebuggerModel.Location>} |
| 722 */ | 719 */ |
| 723 generatorObjectDetails: function(remoteObject, callback) | 720 generatorObjectLocation: function(remoteObject) |
|
dgozman
2016/07/07 00:44:34
I think we don't use this.
kozy
2016/07/07 17:58:02
Done.
| |
| 724 { | 721 { |
| 725 this._agent.getGeneratorObjectDetails(remoteObject.objectId, didGetDetai ls.bind(this)); | 722 if (remoteObject.subtype !== "generator") |
| 723 return Promise.resolve(/** @type {?WebInspector.DebuggerModel.Locati on} */(null)); | |
| 724 return remoteObject.getOwnPropertiesPromise().then(buildLocation.bind(th is)); | |
| 726 | 725 |
| 727 /** | 726 /** |
| 728 * @param {?Protocol.Error} error | 727 * @this {!WebInspector.DebuggerModel} |
| 729 * @param {!DebuggerAgent.GeneratorObjectDetails} response | 728 * @param {!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, in ternalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}} response |
| 730 * @this {WebInspector.DebuggerModel} | 729 * @return {?WebInspector.DebuggerModel.Location} |
| 731 */ | 730 */ |
| 732 function didGetDetails(error, response) | 731 function buildLocation(response) |
| 733 { | 732 { |
| 734 if (error) { | 733 if (!response || !response.internalProperties) |
| 735 console.error(error); | 734 return null; |
| 736 callback(null); | 735 for (var prop of response.internalProperties) { |
| 737 return; | 736 if (prop.name === "[[GeneratorLocation]]") { |
| 737 var loc = prop.value.value; | |
| 738 return this.createRawLocationByScriptId(loc.scriptId, loc.li neNumber, loc.columnNumber); | |
| 739 } | |
| 738 } | 740 } |
| 739 var location = response.location; | 741 return null; |
| 740 var script = location && this.scriptForId(location.scriptId); | |
| 741 var rawLocation = script ? this.createRawLocation(script, location.l ineNumber, location.columnNumber || 0) : null; | |
| 742 var sourceURL = script ? script.contentURL() : null; | |
| 743 callback({location: rawLocation, sourceURL: sourceURL, functionName: response.functionName, status: response.status}); | |
| 744 } | 742 } |
| 745 }, | 743 }, |
| 746 | 744 |
| 747 /** | 745 /** |
| 748 * @param {!DebuggerAgent.BreakpointId} breakpointId | 746 * @param {!DebuggerAgent.BreakpointId} breakpointId |
| 749 * @param {function(!WebInspector.Event)} listener | 747 * @param {function(!WebInspector.Event)} listener |
| 750 * @param {!Object=} thisObject | 748 * @param {!Object=} thisObject |
| 751 */ | 749 */ |
| 752 addBreakpointListener: function(breakpointId, listener, thisObject) | 750 addBreakpointListener: function(breakpointId, listener, thisObject) |
| 753 { | 751 { |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1322 /** | 1320 /** |
| 1323 * @param {?WebInspector.Target} target | 1321 * @param {?WebInspector.Target} target |
| 1324 * @return {?WebInspector.DebuggerModel} | 1322 * @return {?WebInspector.DebuggerModel} |
| 1325 */ | 1323 */ |
| 1326 WebInspector.DebuggerModel.fromTarget = function(target) | 1324 WebInspector.DebuggerModel.fromTarget = function(target) |
| 1327 { | 1325 { |
| 1328 if (!target || !target.hasJSContext()) | 1326 if (!target || !target.hasJSContext()) |
| 1329 return null; | 1327 return null; |
| 1330 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel)); | 1328 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel)); |
| 1331 } | 1329 } |
| OLD | NEW |