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

Unified Diff: Source/devtools/front_end/sources/FilteredItemSelectionDialog.js

Issue 685203003: DevTools: Get rid of synchronous XHRs in the frontend code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 1 month 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: Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
diff --git a/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js b/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
index 4743506a9e01bb5ab68ff2d153d9280ff91b13a6..d979e51f0c3d357b7f3dc32293cdbbbf9d2e100c 100644
--- a/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
@@ -531,9 +531,8 @@ WebInspector.JavaScriptOutlineDialog = function(uiSourceCode, selectItemCallback
this._functionItems = [];
this._selectItemCallback = selectItemCallback;
- this._outlineWorker = Runtime.startWorker("script_formatter_worker");
- this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this);
- this._outlineWorker.postMessage({ method: "javaScriptOutline", params: { content: uiSourceCode.workingCopy() } });
+ this._uiSourceCode = uiSourceCode;
+ WorkerRuntime.startWorker("script_formatter_worker").then(this._init.bind(this));
}
/**
@@ -551,6 +550,16 @@ WebInspector.JavaScriptOutlineDialog.show = function(view, uiSourceCode, selectI
WebInspector.JavaScriptOutlineDialog.prototype = {
/**
+ * @param {!Worker} worker
+ */
+ _init: function(worker)
+ {
+ this._outlineWorker = worker;
+ this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this);
+ this._outlineWorker.postMessage({ method: "javaScriptOutline", params: { content: this._uiSourceCode.workingCopy() } });
+ },
+
+ /**
* @param {!MessageEvent} event
*/
_didBuildOutlineChunk: function(event)

Powered by Google App Engine
This is Rietveld 408576698