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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1786243002: [DevTools] Move restartFrame and setCallFrameVariableValue to V8DebuggerAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dgozman-patch
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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 */ 868 */
869 evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectG roup, injectCommandLineAPI, returnByValue, generatePreview) 869 evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectG roup, injectCommandLineAPI, returnByValue, generatePreview)
870 { 870 {
871 var callFrame = this._callFrameForId(topCallFrame, callFrameId); 871 var callFrame = this._callFrameForId(topCallFrame, callFrameId);
872 if (!callFrame) 872 if (!callFrame)
873 return "Could not find call frame with given id"; 873 return "Could not find call frame with given id";
874 return this._evaluateAndWrap(callFrame, expression, objectGroup, injectC ommandLineAPI, returnByValue, generatePreview); 874 return this._evaluateAndWrap(callFrame, expression, objectGroup, injectC ommandLineAPI, returnByValue, generatePreview);
875 }, 875 },
876 876
877 /** 877 /**
878 * @param {!JavaScriptCallFrame} topCallFrame
879 * @param {string} callFrameId
880 * @return {*}
881 */
882 restartFrame: function(topCallFrame, callFrameId)
883 {
884 var callFrame = this._callFrameForId(topCallFrame, callFrameId);
885 if (!callFrame)
886 return "Could not find call frame with given id";
887 return callFrame.restart();
888 },
889
890 /**
891 * Either callFrameId or functionObjectId must be specified.
892 * @param {!JavaScriptCallFrame} topCallFrame
893 * @param {string|boolean} callFrameId or false
894 * @param {string|boolean} functionObjectId or false
895 * @param {number} scopeNumber
896 * @param {string} variableName
897 * @param {string} newValueJsonString RuntimeAgent.CallArgument structure se rialized as string
898 * @return {string|undefined} undefined if success or an error message
899 */
900 setVariableValue: function(topCallFrame, callFrameId, functionObjectId, scop eNumber, variableName, newValueJsonString)
901 {
902 try {
903 var newValueJson = /** @type {!RuntimeAgent.CallArgument} */ (Inject edScriptHost.eval("(" + newValueJsonString + ")"));
904 var resolvedValue = this._resolveCallArgument(newValueJson);
905 if (typeof callFrameId === "string") {
906 var callFrame = this._callFrameForId(topCallFrame, callFrameId);
907 if (!callFrame)
908 return "Could not find call frame with given id";
909 callFrame.setVariableValue(scopeNumber, variableName, resolvedVa lue)
910 } else {
911 var parsedFunctionId = this._parseObjectId(/** @type {string} */ (functionObjectId));
912 var func = this._objectForId(parsedFunctionId);
913 if (typeof func !== "function")
914 return "Could not resolve function by id";
915 InjectedScriptHost.setFunctionVariableValue(func, scopeNumber, v ariableName, resolvedValue);
916 }
917 } catch (e) {
918 return toString(e);
919 }
920 return undefined;
921 },
922
923 /**
924 * @return {!CommandLineAPI} 878 * @return {!CommandLineAPI}
925 */ 879 */
926 commandLineAPI: function() 880 commandLineAPI: function()
927 { 881 {
928 return new CommandLineAPI(this._commandLineAPIImpl, null); 882 return new CommandLineAPI(this._commandLineAPIImpl, null);
929 }, 883 },
930 884
931 /** 885 /**
932 * @param {!JavaScriptCallFrame} topCallFrame 886 * @param {!JavaScriptCallFrame} topCallFrame
933 * @param {string} callFrameId 887 * @param {string} callFrameId
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 */ 1827 */
1874 _logEvent: function(event) 1828 _logEvent: function(event)
1875 { 1829 {
1876 inspectedGlobalObject.console.log(event.type, event); 1830 inspectedGlobalObject.console.log(event.type, event);
1877 } 1831 }
1878 } 1832 }
1879 1833
1880 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1834 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1881 return injectedScript; 1835 return injectedScript;
1882 }) 1836 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698