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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Issue 2570263002: DevTools: introduce API for the Common.FormatterWorkerPool. (Closed)
Patch Set: address comments Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
index 058cba20ac81173ab76fdf44b965c7f7c2069b3b..11d80c2e62005b3fadd322af23e48b24f9100f48 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -51,7 +51,7 @@ Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
var scopeText = text.extract(scopeRange);
var scopeStart = text.toSourceRange(scopeRange).offset;
var prefix = 'function fui';
- return Common.formatterWorkerPool.runTask('javaScriptIdentifiers', {content: prefix + scopeText})
+ return Common.formatterWorkerPool.javaScriptIdentifiers(prefix + scopeText)
.then(onIdentifiers.bind(null, text, scopeStart, prefix));
}
@@ -59,11 +59,10 @@ Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
* @param {!Common.Text} text
* @param {number} scopeStart
* @param {string} prefix
- * @param {?MessageEvent} event
+ * @param {!Array<!{name: string, offset: number}>} identifiers
* @return {!Array<!Sources.SourceMapNamesResolver.Identifier>}
*/
- function onIdentifiers(text, scopeStart, prefix, event) {
- var identifiers = event ? /** @type {!Array<!{name: string, offset: number}>} */ (event.data) : [];
+ function onIdentifiers(text, scopeStart, prefix, identifiers) {
var result = [];
var cursor = new Common.TextCursor(text.lineEndings());
var promises = [];
@@ -282,15 +281,7 @@ Sources.SourceMapNamesResolver._resolveExpression = function(
var originalText = text.extract(textRange);
if (!originalText)
return Promise.resolve('');
- return Common.formatterWorkerPool.runTask('evaluatableJavaScriptSubstring', {content: originalText}).then(onResult);
- }
-
- /**
- * @param {?MessageEvent} event
- * @return {string}
- */
- function onResult(event) {
- return event ? /** @type {string} */ (event.data) : '';
+ return Common.formatterWorkerPool.evaluatableJavaScriptSubstring(originalText);
}
};
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698