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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 2215153002: [DevTools] Eliminate frameId and isContentScript from js protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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
};
}

Powered by Google App Engine
This is Rietveld 408576698