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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/JSONView.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
Index: third_party/WebKit/Source/devtools/front_end/network/JSONView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/JSONView.js b/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
index 72cabe1b7ecbb2bf7e12f27f4fa5c383c982997b..2b77d450986d5a854c62876400d9fe032e887ce1 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
@@ -76,16 +76,16 @@ Network.JSONView = class extends UI.VBox {
returnObj = Network.JSONView._extractJSON(/** @type {string} */ (text));
if (!returnObj)
return Promise.resolve(/** @type {?Network.ParsedJSON} */ (null));
- return Common.formatterWorkerPool.runTask('relaxedJSONParser', {content: returnObj.data}).then(handleReturnedJSON);
+ return Common.formatterWorkerPool.parseJSONRelaxed(returnObj.data).then(handleReturnedJSON);
/**
- * @param {?MessageEvent} event
+ * @param {*} data
* @return {?Network.ParsedJSON}
*/
- function handleReturnedJSON(event) {
- if (!event || !event.data)
+ function handleReturnedJSON(data) {
+ if (!data)
return null;
- returnObj.data = event.data;
+ returnObj.data = data;
return returnObj;
}
}

Powered by Google App Engine
This is Rietveld 408576698