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) |