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

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: navigation tracker 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..cd9a2bd56dd860ed3c7c8175593642ba8021c0f5 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
@@ -141,14 +141,22 @@ DebuggerScript._executionContextId = function(contextData)
{
if (!contextData)
return 0;
- var firstComma = contextData.indexOf(",");
- if (firstComma === -1)
- return 0;
- var secondComma = contextData.indexOf(",", firstComma + 1);
- if (secondComma === -1)
+ var match = contextData.match(/^[^,]*,([^,]*),.*$/);
+ if (!match)
return 0;
+ return parseInt(match[1], 10) || 0;
+}
- return parseInt(contextData.substring(firstComma + 1, secondComma), 10) || 0;
+/**
+ * @param {string|undefined} contextData
+ * @return {string}
+ */
+DebuggerScript._executionContextAuxData = function(contextData)
+{
+ if (!contextData)
+ return "";
+ var match = contextData.match(/^[^,]*,[^,]*,(.*)$/);
+ return match ? match[1] : "";
}
/**
@@ -168,7 +176,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 +216,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