From cc0efecf5c9c245fc30862c0ecf139e095f5ba88 Mon Sep 17 00:00:00 2001 From: Cristian Tuns Date: Wed, 13 Mar 2024 13:43:40 -0400 Subject: [PATCH] Backed out 3 changesets (bug 1884785, bug 1884265) for causing build bustages in nsLocalHandlerApp.cpp CLOSED TREE Backed out changeset 08cb16bededc (bug 1884265) Backed out changeset dc60eabb35ec (bug 1884785) Backed out changeset 2de1412ec7e3 (bug 1884265) --- netwerk/mime/nsIMIMEInfo.idl | 27 +--- uriloader/exthandler/HandlerServiceParent.cpp | 4 - uriloader/exthandler/moz.build | 1 - uriloader/exthandler/nsLocalHandlerApp.cpp | 96 --------------- uriloader/exthandler/nsLocalHandlerApp.h | 10 -- uriloader/exthandler/nsMIMEInfoImpl.cpp | 15 --- uriloader/exthandler/nsMIMEInfoImpl.h | 2 - .../unit/test_getFromTypeAndExtension.js | 92 -------------- .../exthandler/win/nsLocalHandlerAppWin.cpp | 116 ------------------ .../exthandler/win/nsLocalHandlerAppWin.h | 34 ----- uriloader/exthandler/win/nsMIMEInfoWin.cpp | 30 ++--- uriloader/exthandler/win/nsMIMEInfoWin.h | 3 +- 12 files changed, 11 insertions(+), 419 deletions(-) delete mode 100644 uriloader/exthandler/win/nsLocalHandlerAppWin.cpp delete mode 100644 uriloader/exthandler/win/nsLocalHandlerAppWin.h diff --git a/netwerk/mime/nsIMIMEInfo.idl b/netwerk/mime/nsIMIMEInfo.idl index 97d7660932c2..a7ffcfe513d7 100644 --- a/netwerk/mime/nsIMIMEInfo.idl +++ b/netwerk/mime/nsIMIMEInfo.idl @@ -53,23 +53,18 @@ interface nsIHandlerInfo : nsISupports { readonly attribute nsIMutableArray possibleApplicationHandlers; /** - * Indicates whether a default OS application handler exists, + * Indicates whether a default application handler exists, * i.e. whether launchWithFile with action = useSystemDefault is possible * and defaultDescription will contain usable information. */ readonly attribute boolean hasDefaultHandler; /** - * A pretty name description of the associated default OS application. Only + * A pretty name description of the associated default application. Only * usable if hasDefaultHandler is true. */ readonly attribute AString defaultDescription; - /** - * The default OS application. Only usable if hasDefaultHandler is true. - */ - readonly attribute nsIFile defaultExecutable; - /** * Launches the application with the specified URI, in a way that * depends on the value of preferredAction. preferredAction must be @@ -285,24 +280,6 @@ interface nsILocalHandlerApp : nsIHandlerApp { */ readonly attribute unsigned long parameterCount; - /** - * Asynchronously returns the pretty (user friendly) name of the - * executable. - * - * On Linux and Mac, this is the same as the name - * property. On Mac, that happens to be a nicer name than - * the executable's name without the file extension. - * - * On Windows, this name will be nicer, looked up from the - * registry when it exists and falling back to the FileDescription - * getVersionFieldInfo when the registry data doesn't exist. - * This has the side effect that the prettyName returned - * generally will match the text returned by defaultDescription in - * nsIHandlerInfo. - */ - [implicit_jscontext] - Promise prettyNameAsync(); - /** * Clears the current list of command line parameters. */ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp index 1c83d9628f8c..ab77657dd5f3 100644 --- a/uriloader/exthandler/HandlerServiceParent.cpp +++ b/uriloader/exthandler/HandlerServiceParent.cpp @@ -110,10 +110,6 @@ NS_IMETHODIMP ProxyHandlerInfo::GetDefaultDescription( return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP ProxyHandlerInfo::GetDefaultExecutable(nsIFile** aExecutable) { - return NS_ERROR_NOT_IMPLEMENTED; -} - /* void launchWithURI (in nsIURI aURI, [optional] in BrowsingContext aBrowsingContext); */ NS_IMETHODIMP ProxyHandlerInfo::LaunchWithURI( diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build index e9009eb063c2..cb96c690a69a 100644 --- a/uriloader/exthandler/moz.build +++ b/uriloader/exthandler/moz.build @@ -95,7 +95,6 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": ] elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": UNIFIED_SOURCES += [ - "win/nsLocalHandlerAppWin.cpp", "win/nsMIMEInfoWin.cpp", ] diff --git a/uriloader/exthandler/nsLocalHandlerApp.cpp b/uriloader/exthandler/nsLocalHandlerApp.cpp index 0cc77a015799..6212d2aeb441 100644 --- a/uriloader/exthandler/nsLocalHandlerApp.cpp +++ b/uriloader/exthandler/nsLocalHandlerApp.cpp @@ -8,8 +8,6 @@ #include "nsIURI.h" #include "nsIProcess.h" #include "nsComponentManagerUtils.h" -#include "mozilla/dom/Promise.h" -#include "nsProxyRelease.h" // XXX why does nsMIMEInfoImpl have a threadsafe nsISupports? do we need one // here too? @@ -30,100 +28,6 @@ NS_IMETHODIMP nsLocalHandlerApp::GetName(nsAString& aName) { return NS_OK; } -/** - * This method returns a std::function that will be executed on a thread other - * than the main thread. To facilitate things, it should effectively be a global - * function that does not maintain a reference to the this pointer. There should - * be no reference to any objects that will be shared across threads. Sub-class - * implementations should make local copies of everything they need and capture - * those in the callback. - */ -std::function -nsLocalHandlerApp::GetPrettyNameOnNonMainThreadCallback() { - nsString name; - - // Calculate the name now, on the main thread, so as to avoid - // doing anything with the this pointer on the other thread - auto result = GetName(name); - - return [name, result](nsString& aName) { - aName = name; - return result; - }; -} - -NS_IMETHODIMP -nsLocalHandlerApp::PrettyNameAsync(JSContext* aCx, dom::Promise** aPromise) { - NS_ENSURE_ARG_POINTER(aPromise); - - *aPromise = nullptr; - - if (!mExecutable) { - return NS_ERROR_FAILURE; - } - - nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx); - if (NS_WARN_IF(!global)) { - return NS_ERROR_FAILURE; - } - - ErrorResult err; - RefPtr outer = dom::Promise::Create(global, err); - if (NS_WARN_IF(err.Failed())) { - return err.StealNSResult(); - } - - outer.forget(aPromise); - - nsAutoString executablePath; - nsresult result = mExecutable->GetPath(executablePath); - - if (NS_FAILED(result) || executablePath.IsEmpty()) { - (*aPromise)->MaybeReject(result); - return NS_OK; - } - - nsMainThreadPtrHandle promiseHolder( - new nsMainThreadPtrHolder( - "nsLocalHandlerApp::prettyExecutableName Promise", *aPromise)); - - auto prettyNameGetter = GetPrettyNameOnNonMainThreadCallback(); - - result = NS_DispatchBackgroundTask( - NS_NewRunnableFunction( - __func__, - [promiseHolder /* can't move this because if the dispatch fails, we - call reject on the promiseHolder */ - , - prettyNameGetter = std::move(prettyNameGetter)]() mutable -> void { - nsAutoString prettyExecutableName; - - nsresult result = prettyNameGetter(prettyExecutableName); - - DebugOnly rv = - NS_DispatchToMainThread(NS_NewRunnableFunction( - __func__, - [promiseHolder = std::move(promiseHolder), - prettyExecutableName = std::move(prettyExecutableName), - result]() { - if (NS_FAILED(result)) { - promiseHolder.get()->MaybeReject(result); - } else { - promiseHolder.get()->MaybeResolve(prettyExecutableName); - } - })); - NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), - "NS_DispatchToMainThread failed"); - }), - NS_DISPATCH_EVENT_MAY_BLOCK); - - if (NS_FAILED(result)) { - promiseHolder.get()->MaybeReject(result); - } - - return NS_OK; -} - NS_IMETHODIMP nsLocalHandlerApp::SetName(const nsAString& aName) { mName.Assign(aName); diff --git a/uriloader/exthandler/nsLocalHandlerApp.h b/uriloader/exthandler/nsLocalHandlerApp.h index ebe43f7dcb49..3ea8e3e4fca4 100644 --- a/uriloader/exthandler/nsLocalHandlerApp.h +++ b/uriloader/exthandler/nsLocalHandlerApp.h @@ -12,8 +12,6 @@ #include "nsIFile.h" #include "nsTArray.h" -#include - class nsLocalHandlerApp : public nsILocalHandlerApp { public: NS_DECL_ISUPPORTS @@ -31,9 +29,6 @@ class nsLocalHandlerApp : public nsILocalHandlerApp { protected: virtual ~nsLocalHandlerApp() {} - virtual std::function - GetPrettyNameOnNonMainThreadCallback(); - nsString mName; nsString mDetailedDescription; nsTArray mParameters; @@ -57,11 +52,6 @@ class nsLocalHandlerApp : public nsILocalHandlerApp { # include "mac/nsLocalHandlerAppMac.h" typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t; # endif -#elif XP_WIN -# ifndef NSLOCALHANDLERAPPWIN_H_ -# include "win/nsLocalHandlerAppWin.h" -typedef nsLocalHandlerAppWin PlatformLocalHandlerApp_t; -# endif #else typedef nsLocalHandlerApp PlatformLocalHandlerApp_t; #endif diff --git a/uriloader/exthandler/nsMIMEInfoImpl.cpp b/uriloader/exthandler/nsMIMEInfoImpl.cpp index f985418b8a43..3616ab7fcf3b 100644 --- a/uriloader/exthandler/nsMIMEInfoImpl.cpp +++ b/uriloader/exthandler/nsMIMEInfoImpl.cpp @@ -230,11 +230,6 @@ nsMIMEInfoBase::GetDefaultDescription(nsAString& aDefaultDescription) { return NS_OK; } -NS_IMETHODIMP -nsMIMEInfoBase::GetDefaultExecutable(nsIFile** aExecutable) { - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsMIMEInfoBase::GetPreferredApplicationHandler( nsIHandlerApp** aPreferredAppHandler) { @@ -488,16 +483,6 @@ nsMIMEInfoImpl::GetDefaultDescription(nsAString& aDefaultDescription) { return NS_OK; } -NS_IMETHODIMP nsMIMEInfoImpl::GetDefaultExecutable(nsIFile** aExecutable) { - nsCOMPtr defaultApp = GetDefaultApplication(); - if (defaultApp) { - defaultApp.forget(aExecutable); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsMIMEInfoImpl::GetHasDefaultHandler(bool* _retval) { *_retval = !mDefaultAppDescription.IsEmpty(); diff --git a/uriloader/exthandler/nsMIMEInfoImpl.h b/uriloader/exthandler/nsMIMEInfoImpl.h index d04566b92c58..9b080ac5457c 100644 --- a/uriloader/exthandler/nsMIMEInfoImpl.h +++ b/uriloader/exthandler/nsMIMEInfoImpl.h @@ -57,7 +57,6 @@ class nsMIMEInfoBase : public nsIMIMEInfo { NS_IMETHOD GetPossibleApplicationHandlers( nsIMutableArray** aPossibleAppHandlers) override; NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override; - NS_IMETHOD GetDefaultExecutable(nsIFile** aExecutable) override; NS_IMETHOD LaunchWithFile(nsIFile* aFile) override; NS_IMETHOD LaunchWithURI( nsIURI* aURI, mozilla::dom::BrowsingContext* aBrowsingContext) override; @@ -188,7 +187,6 @@ class nsMIMEInfoImpl : public nsMIMEInfoBase { // nsIMIMEInfo methods NS_IMETHOD GetHasDefaultHandler(bool* _retval) override; NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override; - NS_IMETHOD GetDefaultExecutable(nsIFile** aExecutable) override; NS_IMETHOD IsCurrentAppOSDefault(bool* _retval) override; // additional methods diff --git a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js b/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js index 9103c29056a0..6f4fe52a49f6 100644 --- a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js +++ b/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js @@ -15,95 +15,3 @@ add_task(async function test_utf8_extension() { Assert.equal(someMIME.primaryExtension, ".ั‚ะตัั‚"); } }); - -add_task(async function test_default_executable() { - const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); - let mimeInfo = mimeService.getFromTypeAndExtension("text/html", "html"); - if (mimeInfo !== undefined) { - if (mimeInfo.hasDefaultHandler) { - let defaultExecutableFile = mimeInfo.defaultExecutable; - if (defaultExecutableFile) { - if (AppConstants.platform == "win") { - Assert.ok( - defaultExecutableFile.leafName.endsWith(".exe"), - "Default browser on Windows should end with .exe" - ); - } - } - - let foundDefaultInList = false; - - let appList = mimeInfo.possibleLocalHandlers || []; - for (let index = 0; index < appList.length; index++) { - let app = appList.queryElementAt(index, Ci.nsILocalHandlerApp); - let executablePath = app.executable.path; - - if (executablePath == defaultExecutableFile.path) { - foundDefaultInList = true; - break; - } - } - - Assert.ok( - foundDefaultInList, - "The default browser must be returned in the list of executables from the mime info" - ); - } else { - Assert.throws( - () => mimeInfo.defaultExecutable, - /NS_ERROR_FAILURE/, - "Fetching the defaultExecutable should generate an exception; this line should never be reached" - ); - } - } -}); - -add_task(async function test_pretty_name_for_edge() { - if (AppConstants.platform == "win" && !AppConstants.IS_ESR) { - const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); - - let mimeInfo = mimeService.getFromTypeAndExtension("text/html", "html"); - let appList = mimeInfo?.possibleLocalHandlers || []; - - for (let index = 0; index < appList.length; index++) { - let app = appList.queryElementAt(index, Ci.nsILocalHandlerApp); - let executableName = app.executable.displayName; - let prettyName = await app.prettyNameAsync(); - - // Hardcode Edge, as an extra test, when it's installed - if (executableName == "msedge.exe") { - Assert.equal( - prettyName, - "Microsoft Edge", - "The generated pretty name for MS Edge should match the expectation." - ); - } - - // The pretty name should always be something nicer than the executable name. - // This isn't testing that's nice, but should be good enough to validate that - // something other than the executable is found. - Assert.notEqual(executableName, prettyName); - } - } -}); - -add_task(async function test_pretty_names_match_names_on_non_windows() { - if (AppConstants.platform != "win") { - const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); - - let mimeInfo = mimeService.getFromTypeAndExtension("text/html", "html"); - let appList = mimeInfo?.possibleLocalHandlers || []; - - for (let index = 0; index < appList.length; index++) { - let app = appList.queryElementAt(index, Ci.nsILocalHandlerApp); - let name = app.executable.name; - let prettyName = await app.prettyNameAsync(); - - Assert.equal( - prettyName, - name, - "On platforms other than windows, the prettyName and the name of file handlers should be the same." - ); - } - } -}); diff --git a/uriloader/exthandler/win/nsLocalHandlerAppWin.cpp b/uriloader/exthandler/win/nsLocalHandlerAppWin.cpp deleted file mode 100644 index d1fe75ef04bb..000000000000 --- a/uriloader/exthandler/win/nsLocalHandlerAppWin.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsLocalHandlerAppWin.h" -#include "nsString.h" -#include "nsIWindowsRegKey.h" - -static nsresult GetPrettyNameFromFileDescription( - const nsCOMPtr& executableOnWindows, - const nsString& assignedName, nsString& aName) { - nsresult result = NS_ERROR_FAILURE; - - if (executableOnWindows) { - result = executableOnWindows->GetVersionInfoField("FileDescription", aName); - - if (NS_FAILED(result) || aName.IsEmpty()) { - if (!assignedName.IsEmpty()) { - aName = assignedName; - } else { - result = executableOnWindows->GetLeafName(aName); - } - - if (!aName.IsEmpty()) { - result = NS_OK; - } else { - result = NS_ERROR_FAILURE; - } - } - } - - return result; -} - -static nsresult GetValueFromRegistry(nsString& aName, - const nsCOMPtr& appKey, - const nsString& registryPath, - const nsString& valueName) { - nsresult rv = - appKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT, registryPath, - nsIWindowsRegKey::ACCESS_QUERY_VALUE); - - if (NS_SUCCEEDED(rv)) { - nsAutoString applicationName; - if (NS_SUCCEEDED(appKey->ReadStringValue(valueName, applicationName))) { - aName = applicationName; - return NS_OK; - } - } - - return NS_ERROR_FAILURE; -}; - -std::function -nsLocalHandlerAppWin::GetPrettyNameOnNonMainThreadCallback() { - // Make a copy of executable so that we don't have to worry about any other - // threads - nsCOMPtr executable; - mExecutable->Clone(getter_AddRefs(executable)); - - // Get the windows interface to the file - nsCOMPtr executableOnWindows(do_QueryInterface(executable)); - auto appIdOrName = mAppIdOrName; - auto assignedName = mName; - - std::function callback = - [assignedName, appIdOrName, - executableOnWindows = std::move(executableOnWindows)](nsString& aName) { - // On all platforms, we want a human readable name for an application. - // For example: msedge -> Microsoft Edge Browser - // - // This is generated on mac directly in nsLocalHandlerAppMac::GetName. - // The auto-test coverage for GetName isn't thorough enough to be - // confident that changing GetName on Windows won't cause problems. - // - // Besides that, this is a potentially slow thing to execute, and making - // it asynchronous is preferable. There's a fallback to GetName() in the - // nsLocalHandlerApp::PrettyNameAsync to cover Mac and Linux. - - if (appIdOrName.IsEmpty()) { - return GetPrettyNameFromFileDescription(executableOnWindows, - assignedName, aName); - } - - nsCOMPtr appKey = - do_CreateInstance("@mozilla.org/windows-registry-key;1"); - if (!appKey) { - return GetPrettyNameFromFileDescription(executableOnWindows, - assignedName, aName); - } - - // Check for ApplicationName first. Path: - // HKEY_CLASSES_ROOT\${APP_ID}\Application, Value entry: ApplicationName - nsresult rv = GetValueFromRegistry(aName, appKey, - appIdOrName + u"\\Application"_ns, - u"ApplicationName"_ns); - if (NS_SUCCEEDED(rv) && !aName.IsEmpty()) { - return rv; - } - - // Check for the default on the Applications entry next. - // Path: HKEY_CLASSES_ROOT\Applications\${APP_ID}, Value entry: "" - // (default) - rv = GetValueFromRegistry(aName, appKey, - u"Applications\\"_ns + appIdOrName, u""_ns); - if (NS_SUCCEEDED(rv) && !aName.IsEmpty()) { - return rv; - } - - // Fallthrough to getting the name from the file description - return GetPrettyNameFromFileDescription(executableOnWindows, - assignedName, aName); - }; - - return callback; -} diff --git a/uriloader/exthandler/win/nsLocalHandlerAppWin.h b/uriloader/exthandler/win/nsLocalHandlerAppWin.h deleted file mode 100644 index 68deda05f483..000000000000 --- a/uriloader/exthandler/win/nsLocalHandlerAppWin.h +++ /dev/null @@ -1,34 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef NSLOCALHANDLERAPPWIN_H_ -#define NSLOCALHANDLERAPPWIN_H_ - -#include "nsLocalHandlerApp.h" -#include "nsString.h" - -class nsLocalHandlerAppWin : public nsLocalHandlerApp { - public: - nsLocalHandlerAppWin() {} - - nsLocalHandlerAppWin(const char16_t* aName, nsIFile* aExecutable) - : nsLocalHandlerApp(aName, aExecutable) {} - - nsLocalHandlerAppWin(const nsAString& aName, nsIFile* aExecutable) - : nsLocalHandlerApp(aName, aExecutable) {} - virtual ~nsLocalHandlerAppWin() {} - - void SetAppIdOrName(const nsString& appIdOrName) { - mAppIdOrName = appIdOrName; - } - - protected: - std::function GetPrettyNameOnNonMainThreadCallback() - override; - - private: - nsString mAppIdOrName; -}; - -#endif /*NSLOCALHANDLERAPPMAC_H_*/ diff --git a/uriloader/exthandler/win/nsMIMEInfoWin.cpp b/uriloader/exthandler/win/nsMIMEInfoWin.cpp index b6e2ea7080a7..758b2018a7cd 100644 --- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp +++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp @@ -221,16 +221,6 @@ nsMIMEInfoWin::GetHasDefaultHandler(bool* _retval) { return NS_OK; } -NS_IMETHODIMP nsMIMEInfoWin::GetDefaultExecutable(nsIFile** aExecutable) { - nsCOMPtr defaultApp = GetDefaultApplication(); - if (defaultApp) { - defaultApp.forget(aExecutable); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsMIMEInfoWin::GetEnumerator(nsISimpleEnumerator** _retval) { nsCOMArray properties; @@ -564,7 +554,6 @@ bool nsMIMEInfoWin::GetProgIDVerbCommandHandler(const nsAString& appProgIDName, // entries to lower case and stores them in the trackList array. void nsMIMEInfoWin::ProcessPath(nsCOMPtr& appList, nsTArray& trackList, - const nsAutoString& appIdOrName, const nsAString& appFilesystemCommand) { nsAutoString lower(appFilesystemCommand); ToLowerCase(lower); @@ -580,9 +569,6 @@ void nsMIMEInfoWin::ProcessPath(nsCOMPtr& appList, nsCOMPtr aApp; if (!GetLocalHandlerApp(appFilesystemCommand, aApp)) return; - // Track the app id so that the pretty name can be determined later - (static_cast(aApp.get()))->SetAppIdOrName(appIdOrName); - // Save in our main tracking arrays appList->AppendElement(aApp); trackList.AppendElement(lower); @@ -687,7 +673,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { if (GetProgIDVerbCommandHandler(appProgId, appFilesystemCommand, false) && !IsPathInList(appFilesystemCommand, trackList)) { - ProcessPath(appList, trackList, appProgId, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } } @@ -715,7 +701,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appName, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } regKey->Close(); @@ -743,7 +729,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appProgId, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } regKey->Close(); @@ -776,7 +762,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appValue, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } } @@ -805,7 +791,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appProgId, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } regKey->Close(); @@ -843,7 +829,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appName, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } } @@ -871,7 +857,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { if (!GetAppsVerbCommandHandler(appName, appFilesystemCommand, false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appName, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } regKey->Close(); @@ -896,7 +882,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray** _retval) { if (!GetAppsVerbCommandHandler(appName, appFilesystemCommand, false) || IsPathInList(appFilesystemCommand, trackList)) continue; - ProcessPath(appList, trackList, appName, appFilesystemCommand); + ProcessPath(appList, trackList, appFilesystemCommand); } } } diff --git a/uriloader/exthandler/win/nsMIMEInfoWin.h b/uriloader/exthandler/win/nsMIMEInfoWin.h index a7bc40c6966d..fa972b23a908 100644 --- a/uriloader/exthandler/win/nsMIMEInfoWin.h +++ b/uriloader/exthandler/win/nsMIMEInfoWin.h @@ -22,7 +22,6 @@ class nsMIMEInfoWin : public nsMIMEInfoBase, public nsIPropertyBag { NS_IMETHOD LaunchWithFile(nsIFile* aFile) override; NS_IMETHOD GetHasDefaultHandler(bool* _retval) override; - NS_IMETHOD GetDefaultExecutable(nsIFile** aExecutable) override; NS_IMETHOD GetPossibleLocalHandlers(nsIArray** _retval) override; NS_IMETHOD IsCurrentAppOSDefault(bool* _retval) override; @@ -69,7 +68,7 @@ class nsMIMEInfoWin : public nsMIMEInfoBase, public nsIPropertyBag { // Helper routine used in tracking app lists void ProcessPath(nsCOMPtr& appList, - nsTArray& trackList, const nsAutoString& appId, + nsTArray& trackList, const nsAString& appFilesystemCommand); // Helper routine to call mozilla::ShellExecuteByExplorer