From 36ef7ebb6850afca44eb606099bbbae0ecedcbf3 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Wed, 21 Aug 2019 12:48:14 +0300 Subject: [PATCH] Backed out changeset de151ad69bd6 (bug 1003968) for build bustage. CLOSED TREE --- .../browser_startup_mainthreadio.js | 14 +++++++++++ .../dirprovider/DirectoryProvider.cpp | 25 +++++++++++++++---- toolkit/components/search/SearchService.jsm | 4 --- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/browser/base/content/test/performance/browser_startup_mainthreadio.js b/browser/base/content/test/performance/browser_startup_mainthreadio.js index b015f5da8cc4..df4c15ea2f2c 100644 --- a/browser/base/content/test/performance/browser_startup_mainthreadio.js +++ b/browser/base/content/test/performance/browser_startup_mainthreadio.js @@ -554,6 +554,13 @@ const startupPhases = { stat: 1, close: 1, }, + { + // bug 1003968 + path: "XREAppDist:searchplugins", + condition: WIN, + ignoreIfUnused: true, // with WebRender enabled this may happen during "before becoming idle" + stat: 1, + }, { path: "XCurProcD:extensions", condition: WIN, @@ -658,6 +665,13 @@ const startupPhases = { ignoreIfUnused: true, stat: 3, }, + { + // bug 1003968 + path: "XREAppDist:searchplugins", + condition: WIN, + ignoreIfUnused: true, // with WebRender enabled this may happen during "before handling user events" + stat: 1, + }, ], }; diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp index 9550f856430d..7963dbcf7acc 100644 --- a/browser/components/dirprovider/DirectoryProvider.cpp +++ b/browser/components/dirprovider/DirectoryProvider.cpp @@ -64,11 +64,16 @@ static void AppendDistroSearchDirs(nsIProperties* aDirSvc, if (NS_FAILED(rv)) return; searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins")); + bool exists; + rv = searchPlugins->Exists(&exists); + if (NS_FAILED(rv) || !exists) return; + nsCOMPtr commonPlugins; rv = searchPlugins->Clone(getter_AddRefs(commonPlugins)); if (NS_SUCCEEDED(rv)) { commonPlugins->AppendNative(NS_LITERAL_CSTRING("common")); - array.AppendObject(commonPlugins); + rv = commonPlugins->Exists(&exists); + if (NS_SUCCEEDED(rv) && exists) array.AppendObject(commonPlugins); } nsCOMPtr prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); @@ -87,8 +92,11 @@ static void AppendDistroSearchDirs(nsIProperties* aDirSvc, rv = localePlugins->Clone(getter_AddRefs(defLocalePlugins)); if (NS_SUCCEEDED(rv)) { defLocalePlugins->AppendNative(defLocale); - array.AppendObject(defLocalePlugins); - return; // all done + rv = defLocalePlugins->Exists(&exists); + if (NS_SUCCEEDED(rv) && exists) { + array.AppendObject(defLocalePlugins); + return; // all done + } } } @@ -100,8 +108,11 @@ static void AppendDistroSearchDirs(nsIProperties* aDirSvc, rv = localePlugins->Clone(getter_AddRefs(curLocalePlugins)); if (NS_SUCCEEDED(rv)) { curLocalePlugins->AppendNative(locale); - array.AppendObject(curLocalePlugins); - return; // all done + rv = curLocalePlugins->Exists(&exists); + if (NS_SUCCEEDED(rv) && exists) { + array.AppendObject(curLocalePlugins); + return; // all done + } } } } @@ -155,6 +166,10 @@ DirectoryProvider::AppendingEnumerator::GetNext(nsISupports** aResult) { ++i; } + bool exists; + rv = mNext->Exists(&exists); + if (NS_SUCCEEDED(rv) && exists) break; + mNext = nullptr; } diff --git a/toolkit/components/search/SearchService.jsm b/toolkit/components/search/SearchService.jsm index 6ab3832723c0..e2e45dde415d 100644 --- a/toolkit/components/search/SearchService.jsm +++ b/toolkit/components/search/SearchService.jsm @@ -1062,10 +1062,6 @@ SearchService.prototype = { if (!done) { distDirs.push(dir); } - } catch (ex) { - if (!(ex instanceof OS.File.Error) || !ex.becauseNoSuchFile) { - throw ex; - } } finally { iterator.close(); }