| Index: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
|
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
|
| index 2e856a27d56a79680ed25b79c76b50c26734a054..2befb00414c80b9c4d652ddbae93c18195fb7f8c 100644
|
| --- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
|
| +++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
|
| @@ -139,6 +139,25 @@ DebuggerScript.getCollectionEntries = function(object)
|
| }
|
|
|
| /**
|
| + * @param {!Script} script
|
| + * @return {number}
|
| + */
|
| +DebuggerScript._executionContextId = function(script)
|
| +{
|
| + var context_data = script.context_data;
|
| + if (!context_data)
|
| + return 0;
|
| + var firstComma = context_data.indexOf(",");
|
| + if (firstComma === -1)
|
| + return 0;
|
| + var secondComma = context_data.indexOf(",", firstComma + 1);
|
| + if (secondComma === -1)
|
| + return 0;
|
| +
|
| + return parseInt(context_data.substring(firstComma + 1, secondComma), 10) || 0;
|
| +}
|
| +
|
| +/**
|
| * @param {string} contextGroupId
|
| * @return {!Array<!FormattedScript>}
|
| */
|
| @@ -184,25 +203,6 @@ DebuggerScript._formatScript = function(script)
|
| else
|
| endColumn = script.source.length - (lineEnds[lineCount - 2] + 1);
|
| }
|
| -
|
| - /**
|
| - * @return {number}
|
| - */
|
| - function executionContextId()
|
| - {
|
| - var context_data = script.context_data;
|
| - if (!context_data)
|
| - return 0;
|
| - var firstComma = context_data.indexOf(",");
|
| - if (firstComma === -1)
|
| - return 0;
|
| - var secondComma = context_data.indexOf(",", firstComma + 1);
|
| - if (secondComma === -1)
|
| - return 0;
|
| -
|
| - return parseInt(context_data.substring(firstComma + 1, secondComma), 10) || 0;
|
| - }
|
| -
|
| return {
|
| id: script.id,
|
| name: script.nameOrSourceURL(),
|
| @@ -213,7 +213,7 @@ DebuggerScript._formatScript = function(script)
|
| startColumn: script.column_offset,
|
| endLine: endLine,
|
| endColumn: endColumn,
|
| - executionContextId: executionContextId(),
|
| + executionContextId: DebuggerScript._executionContextId(script),
|
| isContentScript: !!script.context_data && script.context_data.endsWith(",injected"),
|
| isInternalScript: script.is_debugger_script
|
| };
|
| @@ -622,6 +622,15 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
|
| }
|
|
|
| /**
|
| + * @return {number}
|
| + */
|
| + function contextId()
|
| + {
|
| + var script = ensureFuncMirror().script();
|
| + return script ? DebuggerScript._executionContextId(script.value()) : 0;
|
| + }
|
| +
|
| + /**
|
| * @return {number|undefined}
|
| */
|
| function sourceID()
|
| @@ -662,6 +671,7 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
|
| "sourceID": sourceID,
|
| "line": line,
|
| "column": column,
|
| + "contextId": contextId,
|
| "thisObject": thisObject,
|
| "evaluate": evaluate,
|
| "caller": callerFrame,
|
|
|