Bug 1455707: Remove CanShowProfileManager(). r=froydnj
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 15 May 2018 10:43:55 -0700
changeset 490235 c667f8f40c65b0810e3b23fe2d635f273acc6a3f
parent 490234 dfd04e76e5a6617227c9da8c6961564446cf0f9d
child 490236 ddb665c7fad04681b7c449509a1cea2ce9d84e02
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1455707
milestone63.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 1455707: Remove CanShowProfileManager(). r=froydnj MozReview-Commit-ID: IXDSW8suEBd
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -555,27 +555,16 @@ ProcessDDE(nsINativeAppSupport* aNative,
       // If count is 8 or less windows will display an error dialog.
       int32_t count = 20;
       SpinEventLoopUntil([&]() { return --count < 0; });
     }
   }
 }
 #endif
 
-/**
- * Determines if there is support for showing the profile manager
- *
- * @return true in all environments
-*/
-static bool
-CanShowProfileManager()
-{
-  return true;
-}
-
 bool gSafeMode = false;
 
 /**
  * The nsXULAppInfo object implements nsIFactory so that it can be its own
  * singleton.
  */
 class nsXULAppInfo : public nsIXULAppInfo,
                      public nsIObserver,
@@ -2128,20 +2117,16 @@ ProfileLockedDialog(nsIToolkitProfile* a
 
 static const char kProfileManagerURL[] =
   "chrome://mozapps/content/profile/profileSelection.xul";
 
 static ReturnAbortOnError
 ShowProfileManager(nsIToolkitProfileService* aProfileSvc,
                    nsINativeAppSupport* aNative)
 {
-  if (!CanShowProfileManager()) {
-    return NS_ERROR_NOT_IMPLEMENTED;
-  }
-
   nsresult rv;
 
   nsCOMPtr<nsIFile> profD, profLD;
   char16_t* profileNamePtr;
   nsAutoCString profileName;
 
   {
     ScopedXPCOMStartup xpcom;
@@ -2480,19 +2465,17 @@ SelectProfile(nsIProfileLock* *aResult, 
   ar = CheckArg("p", &arg);
   if (ar == ARG_BAD) {
     ar = CheckArg("osint");
     if (ar == ARG_FOUND) {
       PR_fprintf(PR_STDERR, "Error: argument -p is invalid when argument --osint is specified\n");
       return NS_ERROR_FAILURE;
     }
 
-    if (CanShowProfileManager()) {
-      return ShowProfileManager(aProfileSvc, aNative);
-    }
+    return ShowProfileManager(aProfileSvc, aNative);
   }
   if (ar) {
     ar = CheckArg("osint");
     if (ar == ARG_FOUND) {
       PR_fprintf(PR_STDERR, "Error: argument -p is invalid when argument --osint is specified\n");
       return NS_ERROR_FAILURE;
     }
     nsCOMPtr<nsIToolkitProfile> profile;
@@ -2532,27 +2515,25 @@ SelectProfile(nsIProfileLock* *aResult, 
         if (aProfileName)
           aProfileName->Assign(nsDependentCString(arg));
         return NS_OK;
       }
 
       return ProfileLockedDialog(profile, unlocker, aNative, aResult);
     }
 
-    if (CanShowProfileManager()) {
-      return ShowProfileManager(aProfileSvc, aNative);
-    }
+    return ShowProfileManager(aProfileSvc, aNative);
   }
 
   ar = CheckArg("profilemanager", nullptr, CheckArgFlag::CheckOSInt | CheckArgFlag::RemoveArg);
   if (ar == ARG_BAD) {
     PR_fprintf(PR_STDERR, "Error: argument --profilemanager is invalid when argument --osint is specified\n");
     return NS_ERROR_FAILURE;
   }
-  if (ar == ARG_FOUND && CanShowProfileManager()) {
+  if (ar == ARG_FOUND) {
     return ShowProfileManager(aProfileSvc, aNative);
   }
 
 #ifndef MOZ_DEV_EDITION
   // If the only existing profile is the dev-edition-profile and this is not
   // Developer Edition, then no valid profiles were found.
   if (count == 1) {
     nsCOMPtr<nsIToolkitProfile> deProfile;
@@ -2595,17 +2576,17 @@ SelectProfile(nsIProfileLock* *aResult, 
           aProfileName->AssignLiteral("default");
 #endif
         return NS_OK;
       }
     }
   }
 
   bool useDefault = true;
-  if (count > 1 && CanShowProfileManager()) {
+  if (count > 1) {
     aProfileSvc->GetStartWithLastProfile(&useDefault);
   }
 
   if (useDefault) {
     nsCOMPtr<nsIToolkitProfile> profile;
     // GetSelectedProfile will auto-select the only profile if there's just one
     aProfileSvc->GetSelectedProfile(getter_AddRefs(profile));
     if (profile) {
@@ -2663,20 +2644,16 @@ SelectProfile(nsIProfileLock* *aResult, 
         }
         PR_Sleep(kLockRetrySleepMS);
       } while (TimeStamp::Now() - start < TimeDuration::FromSeconds(kLockRetrySeconds));
 
       return ProfileLockedDialog(profile, unlocker, aNative, aResult);
     }
   }
 
-  if (!CanShowProfileManager()) {
-    return NS_ERROR_FAILURE;
-  }
-
   return ShowProfileManager(aProfileSvc, aNative);
 }
 
 /**
  * Checks the compatibility.ini file to see if we have updated our application
  * or otherwise invalidated our caches. If the application has been updated,
  * we return false; otherwise, we return true. We also write the status
  * of the caches (valid/invalid) into the return param aCachesOK. The aCachesOK