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

Side by Side Diff: Source/devtools/front_end/ConsoleView.js

Issue 220903002: DevTools: wrap DebuggerAgent.Location with DebuggerModel.Location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All tests!!! Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 var resultMessage = new WebInspector.ConsoleCommandResult(/** @type {!WebInspector.RemoteObject} */ (result), wasThrown, originatingCommand, this._l inkifier, url, lineNumber, columnNumber); 749 var resultMessage = new WebInspector.ConsoleCommandResult(/** @type {!WebInspector.RemoteObject} */ (result), wasThrown, originatingCommand, this._l inkifier, url, lineNumber, columnNumber);
750 this._messageToViewMessage.put(resultMessage.consoleMessage(), resul tMessage); 750 this._messageToViewMessage.put(resultMessage.consoleMessage(), resul tMessage);
751 target.consoleModel.addMessage(resultMessage.consoleMessage()); 751 target.consoleModel.addMessage(resultMessage.consoleMessage());
752 } 752 }
753 753
754 if (result.type !== "function") { 754 if (result.type !== "function") {
755 addMessage.call(this); 755 addMessage.call(this);
756 return; 756 return;
757 } 757 }
758 758
759 target.debuggerAgent().getFunctionDetails(result.objectId, didGetDetails .bind(this)); 759 result.functionDetails(didGetDetails.bind(this));
760 760
761 /** 761 /**
762 * @param {?Protocol.Error} error 762 * @param {?DebuggerAgent.FunctionDetails} response
763 * @param {!DebuggerAgent.FunctionDetails} response
764 * @this {WebInspector.ConsoleView} 763 * @this {WebInspector.ConsoleView}
765 */ 764 */
766 function didGetDetails(error, response) 765 function didGetDetails(response)
767 { 766 {
768 if (error) { 767 if (!response) {
769 console.error(error);
770 addMessage.call(this); 768 addMessage.call(this);
771 return; 769 return;
772 } 770 }
773 771
774 var url; 772 var url;
775 var lineNumber; 773 var lineNumber;
776 var columnNumber; 774 var columnNumber;
777 var script = WebInspector.debuggerModel.scriptForId(response.locatio n.scriptId); 775 var script = target.debuggerModel.scriptForId(response.location.scri ptId);
778 if (script && script.sourceURL) { 776 if (script && script.sourceURL) {
779 url = script.sourceURL; 777 url = script.sourceURL;
780 lineNumber = response.location.lineNumber + 1; 778 lineNumber = response.location.lineNumber + 1;
781 columnNumber = response.location.columnNumber + 1; 779 columnNumber = response.location.columnNumber + 1;
782 } 780 }
781 // FIXME: this should be using live location.
783 addMessage.call(this, url, lineNumber, columnNumber); 782 addMessage.call(this, url, lineNumber, columnNumber);
784 } 783 }
785 }, 784 },
786 785
787 /** 786 /**
788 * @param {string} text 787 * @param {string} text
789 * @param {boolean} useCommandLineAPI 788 * @param {boolean} useCommandLineAPI
790 */ 789 */
791 _appendCommand: function(text, useCommandLineAPI) 790 _appendCommand: function(text, useCommandLineAPI)
792 { 791 {
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { 1208 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = {
1210 /** 1209 /**
1211 * @return {boolean} 1210 * @return {boolean}
1212 */ 1211 */
1213 handleAction: function() 1212 handleAction: function()
1214 { 1213 {
1215 WebInspector.console.show(); 1214 WebInspector.console.show();
1216 return true; 1215 return true;
1217 } 1216 }
1218 } 1217 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ConsoleModel.js ('k') | Source/devtools/front_end/ConsoleViewMessage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698