Bug 866254: fix failure to initialize search service in cases where the async initialization fails to complete before the synchronous fallback is invoked, r=Yoric
authorGavin Sharp <gavin@gavinsharp.com>
Tue, 07 May 2013 09:47:39 -0400
changeset 142207 cd020c8432e6bb2b3eb58255db1ad8adc40f0d03
parent 142206 5da1839640f5497bc6cdaadce2faa4ce299daee9
child 142208 d95ddf1d37b09e50c3ea2a90a755c09621c81c71
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs866254
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 866254: fix failure to initialize search service in cases where the async initialization fails to complete before the synchronous fallback is invoked, r=Yoric
toolkit/components/search/nsSearchService.js
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -3783,16 +3783,17 @@ var engineMetadataService = {
               let contents = yield OS.File.read(this._jsonFile);
               if (this._initState == engineMetadataService._InitStates.FINISHED_SUCCESS) {
                 // No need to pursue asynchronous initialization,
                 // synchronous fallback was called and has finished.
                 return;
               }
               this._store = JSON.parse(new TextDecoder().decode(contents));
               this._initState = engineMetadataService._InitStates.FINISHED_SUCCESS;
+              return;
             } catch (ex) {
               if (this._initState == engineMetadataService._InitStates.FINISHED_SUCCESS) {
                 // No need to pursue asynchronous initialization,
                 // synchronous fallback was called and has finished.
                 return;
               }
               if (ex.becauseNoSuchFile) {
                 // If the file does not exist, we need to continue initialization