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

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

Issue 1707043002: [DevTools] Support CommandLineAPI in snippets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 return "Could not resolve function by id"; 979 return "Could not resolve function by id";
980 InjectedScriptHost.setFunctionVariableValue(func, scopeNumber, v ariableName, resolvedValue); 980 InjectedScriptHost.setFunctionVariableValue(func, scopeNumber, v ariableName, resolvedValue);
981 } 981 }
982 } catch (e) { 982 } catch (e) {
983 return toString(e); 983 return toString(e);
984 } 984 }
985 return undefined; 985 return undefined;
986 }, 986 },
987 987
988 /** 988 /**
989 * @return {!CommandLineAPI}
990 */
991 commandLineAPI: function()
992 {
993 return new CommandLineAPI(this._commandLineAPIImpl, null);
994 },
995
996 /**
989 * @param {!JavaScriptCallFrame} topCallFrame 997 * @param {!JavaScriptCallFrame} topCallFrame
990 * @param {string} callFrameId 998 * @param {string} callFrameId
991 * @return {?JavaScriptCallFrame} 999 * @return {?JavaScriptCallFrame}
992 */ 1000 */
993 _callFrameForId: function(topCallFrame, callFrameId) 1001 _callFrameForId: function(topCallFrame, callFrameId)
994 { 1002 {
995 var parsedCallFrameId = nullifyObjectProto(/** @type {!Object} */ (Injec tedScriptHost.eval("(" + callFrameId + ")"))); 1003 var parsedCallFrameId = nullifyObjectProto(/** @type {!Object} */ (Injec tedScriptHost.eval("(" + callFrameId + ")")));
996 var ordinal = parsedCallFrameId["ordinal"]; 1004 var ordinal = parsedCallFrameId["ordinal"];
997 var callFrame = topCallFrame; 1005 var callFrame = topCallFrame;
998 while (--ordinal >= 0 && callFrame) 1006 while (--ordinal >= 0 && callFrame)
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 */ 1934 */
1927 _logEvent: function(event) 1935 _logEvent: function(event)
1928 { 1936 {
1929 inspectedGlobalObject.console.log(event.type, event); 1937 inspectedGlobalObject.console.log(event.type, event);
1930 } 1938 }
1931 } 1939 }
1932 1940
1933 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1941 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1934 return injectedScript; 1942 return injectedScript;
1935 }) 1943 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698