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

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

Issue 2747553002: [DevTools] Rework Popover API (Closed)
Patch Set: await Created 3 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) 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 } 1179 }
1180 this.debuggerModel._agent.invoke_evaluateOnCallFrame( 1180 this.debuggerModel._agent.invoke_evaluateOnCallFrame(
1181 { 1181 {
1182 callFrameId: this._payload.callFrameId, 1182 callFrameId: this._payload.callFrameId,
1183 expression: code, objectGroup, includeCommandLineAPI, silent, returnBy Value, generatePreview 1183 expression: code, objectGroup, includeCommandLineAPI, silent, returnBy Value, generatePreview
1184 }, 1184 },
1185 didEvaluateOnCallFrame); 1185 didEvaluateOnCallFrame);
1186 } 1186 }
1187 1187
1188 /** 1188 /**
1189 * @param {string} code
1190 * @param {string} objectGroup
1191 * @param {boolean} includeCommandLineAPI
1192 * @param {boolean} silent
1193 * @param {boolean} returnByValue
1194 * @param {boolean} generatePreview
1195 * @return {!Promise<?SDK.RemoteObject>}
1196 */
1197 evaluatePromise(code, objectGroup, includeCommandLineAPI, silent, returnByValu e, generatePreview) {
1198 var fulfill;
1199 var promise = new Promise(x => fulfill = x);
1200 this.evaluate(
1201 code, objectGroup, includeCommandLineAPI, silent, returnByValue, generat ePreview, callback.bind(this));
1202 return promise;
1203
1204 /**
1205 * @param {?Protocol.Runtime.RemoteObject} result
1206 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails
1207 * @param {string=} error
1208 * @this {SDK.DebuggerModel.CallFrame}
1209 */
1210 function callback(result, exceptionDetails, error) {
1211 if (!result || exceptionDetails)
1212 fulfill(null);
1213 else
1214 fulfill(this.debuggerModel._runtimeModel.createRemoteObject(result));
1215 }
1216 }
1217
1218 /**
1189 * @param {function(?Protocol.Error=)=} callback 1219 * @param {function(?Protocol.Error=)=} callback
1190 */ 1220 */
1191 restart(callback) { 1221 restart(callback) {
1192 /** 1222 /**
1193 * @param {?Protocol.Error} error 1223 * @param {?Protocol.Error} error
1194 * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames 1224 * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames
1195 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace 1225 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace
1196 * @this {SDK.DebuggerModel.CallFrame} 1226 * @this {SDK.DebuggerModel.CallFrame}
1197 */ 1227 */
1198 function protocolCallback(error, callFrames, asyncStackTrace) { 1228 function protocolCallback(error, callFrames, asyncStackTrace) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 stack.callFrames.shift(); 1392 stack.callFrames.shift();
1363 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) 1393 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame))
1364 previous.parent = stack.parent; 1394 previous.parent = stack.parent;
1365 else 1395 else
1366 previous = stack; 1396 previous = stack;
1367 stack = stack.parent; 1397 stack = stack.parent;
1368 } 1398 }
1369 return asyncStackTrace; 1399 return asyncStackTrace;
1370 } 1400 }
1371 }; 1401 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698