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

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: 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..c1c8c256ea33b42db0736effedcffa8264867efe 100644
--- a/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
@@ -531,9 +531,7 @@ 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() } });
+ Runtime.startWorker("script_formatter_worker").then(this._init.bind(this, uiSourceCode));
pfeldman 2014/11/07 14:51:17 nit: this._uiSourceCode = uiSourceCode for simplic
apavlov 2014/11/10 07:44:12 Done.
}
/**
@@ -551,6 +549,17 @@ WebInspector.JavaScriptOutlineDialog.show = function(view, uiSourceCode, selectI
WebInspector.JavaScriptOutlineDialog.prototype = {
/**
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @param {!Worker} worker
+ */
+ _init: function(uiSourceCode, worker)
+ {
+ this._outlineWorker = worker;
+ this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this);
+ this._outlineWorker.postMessage({ method: "javaScriptOutline", params: { content: uiSourceCode.workingCopy() } });
+ },
+
+ /**
* @param {!MessageEvent} event
*/
_didBuildOutlineChunk: function(event)

Powered by Google App Engine
This is Rietveld 408576698