| Index: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| index b0e1dbc5bf881f93960942b6dcf5350fe2262a76..795f6d63b10cf2f4761b0c0e0467e22e7ac56a72 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| @@ -411,6 +411,27 @@ SDK.RuntimeModel = class extends SDK.SDKModel {
|
| {type: type, args: args, executionContextId: executionContextId, timestamp: timestamp, stackTrace: stackTrace};
|
| this.dispatchEventToListeners(SDK.RuntimeModel.Events.ConsoleAPICalled, consoleAPICall);
|
| }
|
| +
|
| + /**
|
| + * @param {!Protocol.Runtime.ScriptId} scriptId
|
| + * @return {number}
|
| + */
|
| + executionContextIdForScriptId(scriptId) {
|
| + var script = this.debuggerModel().scriptForId(scriptId);
|
| + return script ? script.executionContextId : 0;
|
| + }
|
| +
|
| + /**
|
| + * @param {!Protocol.Runtime.StackTrace} stackTrace
|
| + * @return {number}
|
| + */
|
| + executionContextForStackTrace(stackTrace) {
|
| + while (stackTrace && !stackTrace.callFrames.length)
|
| + stackTrace = stackTrace.parent;
|
| + if (!stackTrace || !stackTrace.callFrames.length)
|
| + return 0;
|
| + return this.executionContextIdForScriptId(stackTrace.callFrames[0].scriptId);
|
| + }
|
| };
|
|
|
| SDK.SDKModel.register(SDK.RuntimeModel, SDK.Target.Capability.JS, true);
|
|
|