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