morgan pushed to branch tor-browser-128.4.0esr-14.5-1 at The Tor Project / Applications / Tor Browser

Commits:

6 changed files:

Changes:

  • toolkit/locales/en-US/chrome/mozapps/profile/profileSelection.properties
    ... ... @@ -12,11 +12,6 @@ restartMessageUnlocker=%S is already running, but is not responding. The old %S
    12 12
     restartMessageNoUnlockerMac=A copy of %S is already open. Only one copy of %S can be open at a time.
    
    13 13
     restartMessageUnlockerMac=A copy of %S is already open. The running copy of %S will quit in order to open this one.
    
    14 14
     
    
    15
    -# LOCALIZATION NOTE (profileProblemTitle, profileReadOnly, profileReadOnlyMac, profileAccessDenied):  Messages displayed when the browser profile cannot be accessed or written to. %S is the application name.
    
    16
    -profileProblemTitle=%S Profile Problem
    
    17
    -profileReadOnly=You cannot run %S from a read-only file system.  Please copy %S to another location before trying to use it.
    
    18
    -profileReadOnlyMac=You cannot run %S from a read-only file system.  Please copy %S to your Desktop or Applications folder before trying to use it.
    
    19
    -profileAccessDenied=%S does not have permission to access the profile. Please adjust your file system permissions and try again.
    
    20 15
     # Profile manager
    
    21 16
     # LOCALIZATION NOTE (profileTooltip): First %S is the profile name, second %S is the path to the profile folder.
    
    22 17
     profileTooltip=Profile: ‘%S’ — Path: ‘%S’
    

  • toolkit/profile/nsToolkitProfileService.cpp
    ... ... @@ -1261,10 +1261,9 @@ nsToolkitProfileService::SelectStartupProfile(
    1261 1261
       }
    
    1262 1262
     
    
    1263 1263
       bool wasDefault;
    
    1264
    -  ProfileStatus profileStatus;
    
    1265 1264
       nsresult rv =
    
    1266 1265
           SelectStartupProfile(&argc, argv.get(), aIsResetting, aRootDir, aLocalDir,
    
    1267
    -                           aProfile, aDidCreate, &wasDefault, profileStatus);
    
    1266
    +                           aProfile, aDidCreate, &wasDefault);
    
    1268 1267
     
    
    1269 1268
       // Since we were called outside of the normal startup path complete any
    
    1270 1269
       // startup tasks.
    
    ... ... @@ -1299,8 +1298,7 @@ static void SaltProfileName(nsACString& aName);
    1299 1298
     nsresult nsToolkitProfileService::SelectStartupProfile(
    
    1300 1299
         int* aArgc, char* aArgv[], bool aIsResetting, nsIFile** aRootDir,
    
    1301 1300
         nsIFile** aLocalDir, nsIToolkitProfile** aProfile, bool* aDidCreate,
    
    1302
    -    bool* aWasDefaultSelection, ProfileStatus& aProfileStatus) {
    
    1303
    -  aProfileStatus = PROFILE_STATUS_OK;
    
    1301
    +    bool* aWasDefaultSelection) {
    
    1304 1302
       if (mStartupProfileSelected) {
    
    1305 1303
         return NS_ERROR_ALREADY_INITIALIZED;
    
    1306 1304
       }
    
    ... ... @@ -1393,13 +1391,6 @@ nsresult nsToolkitProfileService::SelectStartupProfile(
    1393 1391
         rv = XRE_GetFileFromPath(arg, getter_AddRefs(lf));
    
    1394 1392
         NS_ENSURE_SUCCESS(rv, rv);
    
    1395 1393
     
    
    1396
    -    aProfileStatus = CheckProfileWriteAccess(lf);
    
    1397
    -    if (PROFILE_STATUS_OK != aProfileStatus) {
    
    1398
    -      NS_ADDREF(*aRootDir = lf);
    
    1399
    -      NS_ADDREF(*aLocalDir = lf);
    
    1400
    -      return NS_ERROR_FAILURE;
    
    1401
    -    }
    
    1402
    -
    
    1403 1394
         // Make sure that the profile path exists and it's a directory.
    
    1404 1395
         bool exists;
    
    1405 1396
         rv = lf->Exists(&exists);
    
    ... ... @@ -2259,47 +2250,3 @@ nsresult XRE_GetFileFromPath(const char* aPath, nsIFile** aResult) {
    2259 2250
     #  error Platform-specific logic needed here.
    
    2260 2251
     #endif
    
    2261 2252
     }
    2262
    -
    
    2263
    -// Check for write permission to the profile directory by trying to create a
    
    2264
    -// new file (after ensuring that no file with the same name exists).
    
    2265
    -ProfileStatus nsToolkitProfileService::CheckProfileWriteAccess(
    
    2266
    -    nsIFile* aProfileDir) {
    
    2267
    -#if defined(XP_UNIX)
    
    2268
    -  constexpr auto writeTestFileName = u".parentwritetest"_ns;
    
    2269
    -#else
    
    2270
    -  constexpr auto writeTestFileName = u"parent.writetest"_ns;
    
    2271
    -#endif
    
    2272
    -
    
    2273
    -  nsCOMPtr<nsIFile> writeTestFile;
    
    2274
    -  nsresult rv = aProfileDir->Clone(getter_AddRefs(writeTestFile));
    
    2275
    -  if (NS_SUCCEEDED(rv)) rv = writeTestFile->Append(writeTestFileName);
    
    2276
    -
    
    2277
    -  if (NS_SUCCEEDED(rv)) {
    
    2278
    -    bool doesExist = false;
    
    2279
    -    rv = writeTestFile->Exists(&doesExist);
    
    2280
    -    if (NS_SUCCEEDED(rv) && doesExist) rv = writeTestFile->Remove(true);
    
    2281
    -  }
    
    2282
    -
    
    2283
    -  if (NS_SUCCEEDED(rv)) {
    
    2284
    -    rv = writeTestFile->Create(nsIFile::NORMAL_FILE_TYPE, 0666);
    
    2285
    -    (void)writeTestFile->Remove(true);
    
    2286
    -  }
    
    2287
    -
    
    2288
    -  ProfileStatus status =
    
    2289
    -      NS_SUCCEEDED(rv) ? PROFILE_STATUS_OK : PROFILE_STATUS_OTHER_ERROR;
    
    2290
    -  if (NS_ERROR_FILE_ACCESS_DENIED == rv)
    
    2291
    -    status = PROFILE_STATUS_ACCESS_DENIED;
    
    2292
    -  else if (NS_ERROR_FILE_READ_ONLY == rv)
    
    2293
    -    status = PROFILE_STATUS_READ_ONLY;
    
    2294
    -
    
    2295
    -  return status;
    
    2296
    -}
    
    2297
    -
    
    2298
    -ProfileStatus nsToolkitProfileService::CheckProfileWriteAccess(
    
    2299
    -    nsIToolkitProfile* aProfile) {
    
    2300
    -  nsCOMPtr<nsIFile> profileDir;
    
    2301
    -  nsresult rv = aProfile->GetRootDir(getter_AddRefs(profileDir));
    
    2302
    -  if (NS_FAILED(rv)) return PROFILE_STATUS_OTHER_ERROR;
    
    2303
    -
    
    2304
    -  return CheckProfileWriteAccess(profileDir);
    
    2305
    -}

  • toolkit/profile/nsToolkitProfileService.h
    ... ... @@ -17,14 +17,6 @@
    17 17
     #include "nsProfileLock.h"
    
    18 18
     #include "nsINIParser.h"
    
    19 19
     
    
    20
    -enum ProfileStatus {
    
    21
    -  PROFILE_STATUS_OK,
    
    22
    -  PROFILE_STATUS_ACCESS_DENIED,
    
    23
    -  PROFILE_STATUS_READ_ONLY,
    
    24
    -  PROFILE_STATUS_IS_LOCKED,
    
    25
    -  PROFILE_STATUS_OTHER_ERROR
    
    26
    -};
    
    27
    -
    
    28 20
     class nsToolkitProfile final
    
    29 21
         : public nsIToolkitProfile,
    
    30 22
           public mozilla::LinkedListElement<RefPtr<nsToolkitProfile>> {
    
    ... ... @@ -81,13 +73,10 @@ class nsToolkitProfileService final : public nsIToolkitProfileService {
    81 73
       nsresult SelectStartupProfile(int* aArgc, char* aArgv[], bool aIsResetting,
    
    82 74
                                     nsIFile** aRootDir, nsIFile** aLocalDir,
    
    83 75
                                     nsIToolkitProfile** aProfile, bool* aDidCreate,
    
    84
    -                                bool* aWasDefaultSelection,
    
    85
    -                                ProfileStatus& aProfileStatus);
    
    76
    +                                bool* aWasDefaultSelection);
    
    86 77
       nsresult CreateResetProfile(nsIToolkitProfile** aNewProfile);
    
    87 78
       nsresult ApplyResetProfile(nsIToolkitProfile* aOldProfile);
    
    88 79
       void CompleteStartup();
    
    89
    -  static ProfileStatus CheckProfileWriteAccess(nsIToolkitProfile* aProfile);
    
    90
    -  static ProfileStatus CheckProfileWriteAccess(nsIFile* aProfileDir);
    
    91 80
     
    
    92 81
      private:
    
    93 82
       friend class nsToolkitProfile;
    

  • toolkit/torbutton/chrome/locale/en-US/torbutton.properties deleted
    1
    -# Copyright (c) 2022, The Tor Project, Inc.
    
    2
    -# This Source Code Form is subject to the terms of the Mozilla Public
    
    3
    -# License, v. 2.0. If a copy of the MPL was not distributed with this
    
    4
    -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    
    5
    -
    
    6
    -# Profile/startup error messages.
    
    7
    -# LOCALIZATION NOTE: %S is the application name.
    
    8
    -profileProblemTitle=%S Profile Problem
    
    9
    -profileReadOnly=You cannot run %S from a read-only file system.  Please copy %S to another location before trying to use it.
    
    10
    -profileReadOnlyMac=You cannot run %S from a read-only file system.  Please copy %S to your Desktop or Applications folder before trying to use it.
    
    11
    -profileAccessDenied=%S does not have permission to access the profile. Please adjust your file system permissions and try again.

  • toolkit/xre/ProfileReset.cpp
    ... ... @@ -23,8 +23,8 @@
    23 23
     
    
    24 24
     using namespace mozilla;
    
    25 25
     
    
    26
    -extern const XREAppData* gAppData;
    
    27
    -
    
    26
    +static const char kBrandProperties[] =
    
    27
    +    "chrome://branding/locale/brand.properties";
    
    28 28
     static const char kProfileProperties[] =
    
    29 29
         "chrome://mozapps/locale/profile/profileSelection.properties";
    
    30 30
     
    
    ... ... @@ -49,12 +49,21 @@ nsresult ProfileResetCleanup(nsToolkitProfileService* aService,
    49 49
           mozilla::components::StringBundle::Service();
    
    50 50
       if (!sbs) return NS_ERROR_FAILURE;
    
    51 51
     
    
    52
    +  nsCOMPtr<nsIStringBundle> brandBundle;
    
    53
    +  Unused << sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    54
    +  if (!brandBundle) return NS_ERROR_FAILURE;
    
    55
    +
    
    52 56
       nsCOMPtr<nsIStringBundle> sb;
    
    53 57
       Unused << sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    54 58
       if (!sb) return NS_ERROR_FAILURE;
    
    55 59
     
    
    56
    -  NS_ConvertUTF8toUTF16 appName(gAppData->name);
    
    57
    -  AutoTArray<nsString, 2> params = {appName, appName};
    
    60
    +  nsAutoString appName;
    
    61
    +  rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    62
    +  if (NS_FAILED(rv)) return rv;
    
    63
    +
    
    64
    +  AutoTArray<nsString, 2> params;
    
    65
    +  params.AppendElement(appName);
    
    66
    +  params.AppendElement(appName);
    
    58 67
     
    
    59 68
       nsAutoString resetBackupDirectoryName;
    
    60 69
     
    

  • toolkit/xre/nsAppRunner.cpp
    ... ... @@ -2599,91 +2599,8 @@ nsresult LaunchChild(bool aBlankCommandLine, bool aTryExec) {
    2599 2599
       return NS_ERROR_LAUNCHED_CHILD_PROCESS;
    
    2600 2600
     }
    
    2601 2601
     
    
    2602
    -static nsresult GetOverrideStringBundleForLocale(nsIStringBundleService* aSBS,
    
    2603
    -                                                 const char* aTorbuttonURI,
    
    2604
    -                                                 const char* aLocale,
    
    2605
    -                                                 nsIStringBundle** aResult) {
    
    2606
    -  NS_ENSURE_ARG(aSBS);
    
    2607
    -  NS_ENSURE_ARG(aTorbuttonURI);
    
    2608
    -  NS_ENSURE_ARG(aLocale);
    
    2609
    -  NS_ENSURE_ARG(aResult);
    
    2610
    -
    
    2611
    -  const char* kFormatStr =
    
    2612
    -      "jar:%s!/chrome/torbutton/locale/%s/torbutton.properties";
    
    2613
    -  nsPrintfCString strBundleURL(kFormatStr, aTorbuttonURI, aLocale);
    
    2614
    -  nsresult rv = aSBS->CreateBundle(strBundleURL.get(), aResult);
    
    2615
    -  NS_ENSURE_SUCCESS(rv, rv);
    
    2616
    -
    
    2617
    -  // To ensure that we have a valid string bundle, try to retrieve a string
    
    2618
    -  // that we know exists.
    
    2619
    -  nsAutoString val;
    
    2620
    -  rv = (*aResult)->GetStringFromName("profileProblemTitle", val);
    
    2621
    -  if (!NS_SUCCEEDED(rv)) *aResult = nullptr;  // No good.  Discard it.
    
    2622
    -
    
    2623
    -  return rv;
    
    2624
    -}
    
    2625
    -
    
    2626
    -static void GetOverrideStringBundle(nsIStringBundleService* aSBS,
    
    2627
    -                                    nsIStringBundle** aResult) {
    
    2628
    -  if (!aSBS || !aResult) return;
    
    2629
    -
    
    2630
    -  *aResult = nullptr;
    
    2631
    -
    
    2632
    -  // Build Torbutton file URI string by starting from GREDir.
    
    2633
    -  RefPtr<nsXREDirProvider> dirProvider = nsXREDirProvider::GetSingleton();
    
    2634
    -  if (!dirProvider) return;
    
    2635
    -
    
    2636
    -  nsCOMPtr<nsIFile> greDir = dirProvider->GetGREDir();
    
    2637
    -  if (!greDir) return;
    
    2638
    -
    
    2639
    -  // Create file URI, extract as string, and append omni.ja relative path.
    
    2640
    -  nsCOMPtr<nsIURI> uri;
    
    2641
    -  nsAutoCString uriString;
    
    2642
    -  if (NS_FAILED(NS_NewFileURI(getter_AddRefs(uri), greDir)) ||
    
    2643
    -      NS_FAILED(uri->GetSpec(uriString))) {
    
    2644
    -    return;
    
    2645
    -  }
    
    2646
    -
    
    2647
    -  uriString.Append("omni.ja");
    
    2648
    -
    
    2649
    -  nsAutoCString userAgentLocale;
    
    2650
    -  if (!NS_SUCCEEDED(
    
    2651
    -          Preferences::GetCString("intl.locale.requested", userAgentLocale))) {
    
    2652
    -    return;
    
    2653
    -  }
    
    2654
    -
    
    2655
    -  nsresult rv = GetOverrideStringBundleForLocale(
    
    2656
    -      aSBS, uriString.get(), userAgentLocale.get(), aResult);
    
    2657
    -  if (NS_FAILED(rv)) {
    
    2658
    -    // Try again using base locale, e.g., "en" vs. "en-US".
    
    2659
    -    int16_t offset = userAgentLocale.FindChar('-', 1);
    
    2660
    -    if (offset > 0) {
    
    2661
    -      nsAutoCString shortLocale(Substring(userAgentLocale, 0, offset));
    
    2662
    -      rv = GetOverrideStringBundleForLocale(aSBS, uriString.get(),
    
    2663
    -                                            shortLocale.get(), aResult);
    
    2664
    -    }
    
    2665
    -  }
    
    2666
    -}
    
    2667
    -
    
    2668
    -static nsresult GetFormattedString(nsIStringBundle* aOverrideBundle,
    
    2669
    -                                   nsIStringBundle* aMainBundle,
    
    2670
    -                                   const char* aName,
    
    2671
    -                                   const nsTArray<nsString>& aParams,
    
    2672
    -                                   nsAString& aResult) {
    
    2673
    -  NS_ENSURE_ARG(aName);
    
    2674
    -
    
    2675
    -  nsresult rv = NS_ERROR_FAILURE;
    
    2676
    -  if (aOverrideBundle) {
    
    2677
    -    rv = aOverrideBundle->FormatStringFromName(aName, aParams, aResult);
    
    2678
    -  }
    
    2679
    -
    
    2680
    -  // If string was not found in override bundle, use main (browser) bundle.
    
    2681
    -  if (NS_FAILED(rv) && aMainBundle)
    
    2682
    -    rv = aMainBundle->FormatStringFromName(aName, aParams, aResult);
    
    2683
    -
    
    2684
    -  return rv;
    
    2685
    -}
    
    2686
    -
    
    2602
    +static const char kBrandProperties[] =
    
    2603
    +    "chrome://branding/locale/brand.properties";
    
    2687 2604
     static const char kProfileProperties[] =
    
    2688 2605
         "chrome://mozapps/locale/profile/profileSelection.properties";
    
    2689 2606
     
    
    ... ... @@ -2753,12 +2670,20 @@ static nsresult ProfileMissingDialog(nsINativeAppSupport* aNative) {
    2753 2670
             mozilla::components::StringBundle::Service();
    
    2754 2671
         NS_ENSURE_TRUE(sbs, NS_ERROR_FAILURE);
    
    2755 2672
     
    
    2673
    +    nsCOMPtr<nsIStringBundle> brandBundle;
    
    2674
    +    sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    2675
    +    NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2756 2676
         nsCOMPtr<nsIStringBundle> sb;
    
    2757 2677
         sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    2758 2678
         NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2759 2679
     
    
    2760
    -    NS_ConvertUTF8toUTF16 appName(MOZ_APP_DISPLAYNAME);
    
    2761
    -    AutoTArray<nsString, 2> params = {appName, appName};
    
    2680
    +    nsAutoString appName;
    
    2681
    +    rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    2682
    +    NS_ENSURE_SUCCESS(rv, NS_ERROR_ABORT);
    
    2683
    +
    
    2684
    +    AutoTArray<nsString, 2> params;
    
    2685
    +    params.AppendElement(appName);
    
    2686
    +    params.AppendElement(appName);
    
    2762 2687
     
    
    2763 2688
         // profileMissing
    
    2764 2689
         nsAutoString missingMessage;
    
    ... ... @@ -2782,12 +2707,11 @@ static nsresult ProfileMissingDialog(nsINativeAppSupport* aNative) {
    2782 2707
     
    
    2783 2708
     // If aUnlocker is NULL, it is also OK for the following arguments to be NULL:
    
    2784 2709
     //   aProfileDir, aProfileLocalDir, aResult.
    
    2785
    -static ReturnAbortOnError ProfileErrorDialog(nsIFile* aProfileDir,
    
    2786
    -                                             nsIFile* aProfileLocalDir,
    
    2787
    -                                             ProfileStatus aStatus,
    
    2788
    -                                             nsIProfileUnlocker* aUnlocker,
    
    2789
    -                                             nsINativeAppSupport* aNative,
    
    2790
    -                                             nsIProfileLock** aResult) {
    
    2710
    +static ReturnAbortOnError ProfileLockedDialog(nsIFile* aProfileDir,
    
    2711
    +                                              nsIFile* aProfileLocalDir,
    
    2712
    +                                              nsIProfileUnlocker* aUnlocker,
    
    2713
    +                                              nsINativeAppSupport* aNative,
    
    2714
    +                                              nsIProfileLock** aResult) {
    
    2791 2715
       nsresult rv;
    
    2792 2716
     
    
    2793 2717
       if (aProfileDir) {
    
    ... ... @@ -2821,43 +2745,37 @@ static ReturnAbortOnError ProfileErrorDialog(nsIFile* aProfileDir,
    2821 2745
             mozilla::components::StringBundle::Service();
    
    2822 2746
         NS_ENSURE_TRUE(sbs, NS_ERROR_FAILURE);
    
    2823 2747
     
    
    2748
    +    nsCOMPtr<nsIStringBundle> brandBundle;
    
    2749
    +    sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    2750
    +    NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2824 2751
         nsCOMPtr<nsIStringBundle> sb;
    
    2825 2752
         sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    2826 2753
         NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2827 2754
     
    
    2828
    -    nsCOMPtr<nsIStringBundle> overrideSB;
    
    2829
    -    GetOverrideStringBundle(sbs, getter_AddRefs(overrideSB));
    
    2755
    +    nsAutoString appName;
    
    2756
    +    rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    2757
    +    NS_ENSURE_SUCCESS(rv, NS_ERROR_ABORT);
    
    2830 2758
     
    
    2831
    -    NS_ConvertUTF8toUTF16 appName(MOZ_APP_DISPLAYNAME);
    
    2832
    -    AutoTArray<nsString, 3> params = {appName, appName, appName};
    
    2759
    +    AutoTArray<nsString, 3> params;
    
    2760
    +    params.AppendElement(appName);
    
    2761
    +    params.AppendElement(appName);
    
    2762
    +    params.AppendElement(appName);
    
    2833 2763
     
    
    2834 2764
         nsAutoString killMessage;
    
    2835 2765
     #ifndef XP_MACOSX
    
    2836
    -    static const char kRestartUnlocker[] = "restartMessageUnlocker";
    
    2837
    -    static const char kRestartNoUnlocker[] = "restartMessageNoUnlocker2";
    
    2838
    -    static const char kReadOnly[] = "profileReadOnly";
    
    2766
    +    rv = sb->FormatStringFromName(
    
    2767
    +        aUnlocker ? "restartMessageUnlocker" : "restartMessageNoUnlocker2",
    
    2768
    +        params, killMessage);
    
    2839 2769
     #else
    
    2840
    -    static const char kRestartUnlocker[] = "restartMessageUnlockerMac";
    
    2841
    -    static const char kRestartNoUnlocker[] = "restartMessageNoUnlockerMac";
    
    2842
    -    static const char kReadOnly[] = "profileReadOnlyMac";
    
    2843
    -#endif
    
    2844
    -    static const char kAccessDenied[] = "profileAccessDenied";
    
    2845
    -
    
    2846
    -    const char* errorKey = aUnlocker ? kRestartUnlocker : kRestartNoUnlocker;
    
    2847
    -    if (PROFILE_STATUS_READ_ONLY == aStatus)
    
    2848
    -      errorKey = kReadOnly;
    
    2849
    -    else if (PROFILE_STATUS_ACCESS_DENIED == aStatus)
    
    2850
    -      errorKey = kAccessDenied;
    
    2851
    -    rv = GetFormattedString(overrideSB, sb, errorKey, params, killMessage);
    
    2770
    +    rv = sb->FormatStringFromName(
    
    2771
    +        aUnlocker ? "restartMessageUnlockerMac" : "restartMessageNoUnlockerMac",
    
    2772
    +        params, killMessage);
    
    2773
    +#endif
    
    2852 2774
         NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
    
    2853 2775
     
    
    2854
    -    const char* titleKey = ((PROFILE_STATUS_READ_ONLY == aStatus) ||
    
    2855
    -                            (PROFILE_STATUS_ACCESS_DENIED == aStatus))
    
    2856
    -                               ? "profileProblemTitle"
    
    2857
    -                               : "restartTitle";
    
    2858 2776
         params.SetLength(1);
    
    2859 2777
         nsAutoString killTitle;
    
    2860
    -    rv = sb->FormatStringFromName(titleKey, params, killTitle);
    
    2778
    +    rv = sb->FormatStringFromName("restartTitle", params, killTitle);
    
    2861 2779
         NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
    
    2862 2780
     
    
    2863 2781
     #ifdef MOZ_BACKGROUNDTASKS
    
    ... ... @@ -3028,24 +2946,6 @@ static ReturnAbortOnError ShowProfileManager(
    3028 2946
       return LaunchChild(false, true);
    
    3029 2947
     }
    
    3030 2948
     
    
    3031
    -#ifdef XP_MACOSX
    
    3032
    -static ProfileStatus CheckTorBrowserDataWriteAccess() {
    
    3033
    -  // Check whether we can write to the directory that will contain
    
    3034
    -  // TorBrowser-Data.
    
    3035
    -  RefPtr<nsXREDirProvider> singleton = nsXREDirProvider::GetSingleton();
    
    3036
    -  if (!singleton) {
    
    3037
    -    return PROFILE_STATUS_OTHER_ERROR;
    
    3038
    -  }
    
    3039
    -  nsCOMPtr<nsIFile> tbDataDir;
    
    3040
    -  nsresult rv = singleton->GetTorBrowserUserDataDir(getter_AddRefs(tbDataDir));
    
    3041
    -  NS_ENSURE_SUCCESS(rv, PROFILE_STATUS_OTHER_ERROR);
    
    3042
    -  nsCOMPtr<nsIFile> tbDataDirParent;
    
    3043
    -  rv = tbDataDir->GetParent(getter_AddRefs(tbDataDirParent));
    
    3044
    -  NS_ENSURE_SUCCESS(rv, PROFILE_STATUS_OTHER_ERROR);
    
    3045
    -  return nsToolkitProfileService::CheckProfileWriteAccess(tbDataDirParent);
    
    3046
    -}
    
    3047
    -#endif
    
    3048
    -
    
    3049 2949
     static bool gDoMigration = false;
    
    3050 2950
     static bool gDoProfileReset = false;
    
    3051 2951
     static nsCOMPtr<nsIToolkitProfile> gResetOldProfile;
    
    ... ... @@ -3053,13 +2953,6 @@ static nsCOMPtr<nsIToolkitProfile> gResetOldProfile;
    3053 2953
     static nsresult LockProfile(nsINativeAppSupport* aNative, nsIFile* aRootDir,
    
    3054 2954
                                 nsIFile* aLocalDir, nsIToolkitProfile* aProfile,
    
    3055 2955
                                 nsIProfileLock** aResult) {
    
    3056
    -  ProfileStatus status =
    
    3057
    -      (aProfile ? nsToolkitProfileService::CheckProfileWriteAccess(aProfile)
    
    3058
    -                : nsToolkitProfileService::CheckProfileWriteAccess(aRootDir));
    
    3059
    -  if (PROFILE_STATUS_OK != status)
    
    3060
    -    return ProfileErrorDialog(aRootDir, aLocalDir, status, nullptr, aNative,
    
    3061
    -                              aResult);
    
    3062
    -
    
    3063 2956
       // If you close Firefox and very quickly reopen it, the old Firefox may
    
    3064 2957
       // still be closing down. Rather than immediately showing the
    
    3065 2958
       // "Firefox is running but is not responding" message, we spend a few
    
    ... ... @@ -3086,8 +2979,7 @@ static nsresult LockProfile(nsINativeAppSupport* aNative, nsIFile* aRootDir,
    3086 2979
       } while (TimeStamp::Now() - start <
    
    3087 2980
                TimeDuration::FromSeconds(kLockRetrySeconds));
    
    3088 2981
     
    
    3089
    -  return ProfileErrorDialog(aRootDir, aLocalDir, PROFILE_STATUS_IS_LOCKED,
    
    3090
    -                            unlocker, aNative, aResult);
    
    2982
    +  return ProfileLockedDialog(aRootDir, aLocalDir, unlocker, aNative, aResult);
    
    3091 2983
     }
    
    3092 2984
     
    
    3093 2985
     // Pick a profile. We need to end up with a profile root dir, local dir and
    
    ... ... @@ -3102,8 +2994,7 @@ static nsresult LockProfile(nsINativeAppSupport* aNative, nsIFile* aRootDir,
    3102 2994
     static nsresult SelectProfile(nsToolkitProfileService* aProfileSvc,
    
    3103 2995
                                   nsINativeAppSupport* aNative, nsIFile** aRootDir,
    
    3104 2996
                                   nsIFile** aLocalDir, nsIToolkitProfile** aProfile,
    
    3105
    -                              bool* aWasDefaultSelection,
    
    3106
    -                              nsIProfileLock** aResult) {
    
    2997
    +                              bool* aWasDefaultSelection) {
    
    3107 2998
       StartupTimeline::Record(StartupTimeline::SELECT_PROFILE);
    
    3108 2999
     
    
    3109 3000
       nsresult rv;
    
    ... ... @@ -3141,14 +3032,9 @@ static nsresult SelectProfile(nsToolkitProfileService* aProfileSvc,
    3141 3032
     
    
    3142 3033
       // Ask the profile manager to select the profile directories to use.
    
    3143 3034
       bool didCreate = false;
    
    3144
    -  ProfileStatus profileStatus = PROFILE_STATUS_OK;
    
    3145
    -  rv = aProfileSvc->SelectStartupProfile(
    
    3146
    -      &gArgc, gArgv, gDoProfileReset, aRootDir, aLocalDir, aProfile, &didCreate,
    
    3147
    -      aWasDefaultSelection, profileStatus);
    
    3148
    -  if (PROFILE_STATUS_OK != profileStatus) {
    
    3149
    -    return ProfileErrorDialog(*aRootDir, *aLocalDir, profileStatus, nullptr,
    
    3150
    -                              aNative, aResult);
    
    3151
    -  }
    
    3035
    +  rv = aProfileSvc->SelectStartupProfile(&gArgc, gArgv, gDoProfileReset,
    
    3036
    +                                         aRootDir, aLocalDir, aProfile,
    
    3037
    +                                         &didCreate, aWasDefaultSelection);
    
    3152 3038
     
    
    3153 3039
       if (rv == NS_ERROR_SHOW_PROFILE_MANAGER) {
    
    3154 3040
         return ShowProfileManager(aProfileSvc, aNative);
    
    ... ... @@ -5062,19 +4948,6 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
    5062 4948
     
    
    5063 4949
       mProfileSvc = NS_GetToolkitProfileService();
    
    5064 4950
       if (!mProfileSvc) {
    
    5065
    -#ifdef XP_MACOSX
    
    5066
    -    // NS_NewToolkitProfileService() returns a generic NS_ERROR_FAILURE error
    
    5067
    -    // if creation of the TorBrowser-Data directory fails due to access denied
    
    5068
    -    // or because of a read-only disk volume. Do an extra check here to detect
    
    5069
    -    // these errors so we can display an informative error message.
    
    5070
    -    ProfileStatus status = CheckTorBrowserDataWriteAccess();
    
    5071
    -    if ((PROFILE_STATUS_ACCESS_DENIED == status) ||
    
    5072
    -        (PROFILE_STATUS_READ_ONLY == status)) {
    
    5073
    -      ProfileErrorDialog(nullptr, nullptr, status, nullptr, mNativeApp,
    
    5074
    -                         nullptr);
    
    5075
    -      return 1;
    
    5076
    -    }
    
    5077
    -#endif
    
    5078 4951
         // We failed to choose or create profile - notify user and quit
    
    5079 4952
         ProfileMissingDialog(mNativeApp);
    
    5080 4953
         return 1;
    
    ... ... @@ -5084,7 +4957,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
    5084 4957
       nsCOMPtr<nsIToolkitProfile> profile;
    
    5085 4958
       rv = SelectProfile(mProfileSvc, mNativeApp, getter_AddRefs(mProfD),
    
    5086 4959
                          getter_AddRefs(mProfLD), getter_AddRefs(profile),
    
    5087
    -                     &wasDefaultSelection, getter_AddRefs(mProfileLock));
    
    4960
    +                     &wasDefaultSelection);
    
    5088 4961
       if (rv == NS_ERROR_LAUNCHED_CHILD_PROCESS || rv == NS_ERROR_ABORT) {
    
    5089 4962
         *aExitFlag = true;
    
    5090 4963
         return 0;