Chromium Code Reviews| 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 5b534f322160f330c555e8ce17f66dfc8c3454ea..1d94b037b980be2c26a68c6e55f4a9fffc21ab63 100644 |
| --- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js |
| +++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js |
| @@ -152,6 +152,24 @@ DebuggerScript._executionContextId = function(contextData) |
| } |
| /** |
| + * @param {string|undefined} contextData |
| + * @return {string} |
| + */ |
| +DebuggerScript._executionContextAuxData = function(contextData) |
| +{ |
| + if (!contextData) |
| + return ""; |
| + var firstComma = contextData.indexOf(","); |
|
kozy
2016/08/05 02:35:41
Can we use regexp here?
var matches = contextData.
dgozman
2016/08/05 18:00:38
Done.
|
| + if (firstComma === -1) |
| + return ""; |
| + var secondComma = contextData.indexOf(",", firstComma + 1); |
| + if (secondComma === -1) |
| + return ""; |
| + |
| + return contextData.substring(secondComma + 1); |
| +} |
| + |
| +/** |
| * @param {string} contextGroupId |
| * @return {!Array<!FormattedScript>} |
| */ |
| @@ -168,7 +186,7 @@ DebuggerScript.getScripts = function(contextGroupId) |
| if (!script.context_data) |
| continue; |
| // Context data is a string in the following format: |
| - // <contextGroupId>,<contextId>,("default"|"nondefault") |
| + // <contextGroupId>,<contextId>,<auxData> |
| if (script.context_data.indexOf(contextDataPrefix) !== 0) |
| continue; |
| } |
| @@ -208,7 +226,8 @@ DebuggerScript._formatScript = function(script) |
| endLine: endLine, |
| endColumn: endColumn, |
| executionContextId: DebuggerScript._executionContextId(script.context_data), |
| - isContentScript: !!script.context_data && script.context_data.endsWith(",nondefault"), |
| + // Note that we cannot derive aux data from context id because of compilation cache. |
| + executionContextAuxData: DebuggerScript._executionContextAuxData(script.context_data), |
| isInternalScript: script.is_debugger_script |
| }; |
| } |