Bug 1533677: Don't lock the profile when selecting one from the profile manager until we've attempted to remote our arguments to an existing instance. r=Gijs
authorDave Townsend <dtownsend@oxymoronical.com>
Fri, 08 Mar 2019 20:43:42 +0000
changeset 521188 4e32ce5a2df5
parent 521187 5ece136b35f9
child 521189 64d42eb569d2
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1533677, 1530615
milestone67.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 1533677: Don't lock the profile when selecting one from the profile manager until we've attempted to remote our arguments to an existing instance. r=Gijs If the user selects a profile we will either remote the current arguments to it or we'll restart into it. Either way we don't need to check if the profile is locked at this point. We also don't need to double check if the profile is missing since bug 1530615 landed. Differential Revision: https://phabricator.services.mozilla.com/D22758
toolkit/profile/content/profileSelection.js
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/profile/content/profileSelection.js
+++ b/toolkit/profile/content/profileSelection.js
@@ -83,37 +83,18 @@ function acceptDialog() {
     var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle");
     var pleaseSelect =
       gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]);
     Services.prompt.alert(window, pleaseSelectTitle, pleaseSelect);
 
     return false;
   }
 
-  var profileLock;
-
-  try {
-    profileLock = selectedProfile.profile.lock({ value: null });
-  } catch (e) {
-    if (!selectedProfile.profile.rootDir.exists()) {
-      var missingTitle = gProfileManagerBundle.getString("profileMissingTitle");
-      var missing =
-        gProfileManagerBundle.getFormattedString("profileMissing", [appName]);
-      Services.prompt.alert(window, missingTitle, missing);
-      return false;
-    }
-
-    var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle");
-    var locked =
-      gProfileManagerBundle.getFormattedString("profileLocked2", [appName, selectedProfile.profile.name, appName]);
-    Services.prompt.alert(window, lockedTitle, locked);
-
-    return false;
-  }
-  gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0);
+  gDialogParams.objects.insertElementAt(selectedProfile.profile.rootDir, 0);
+  gDialogParams.objects.insertElementAt(selectedProfile.profile.localDir, 1);
 
   try {
     gProfileService.defaultProfile = selectedProfile.profile;
   } catch (e) {
     // This can happen on dev-edition. We'll still restart with the selected
     // profile based on the lock's directories.
   }
   updateStartupPrefs();
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1879,28 +1879,23 @@ static ReturnAbortOnError ShowProfileMan
       int32_t dialogConfirmed;
       rv = ioParamBlock->GetInt(0, &dialogConfirmed);
       if (NS_FAILED(rv) || dialogConfirmed == 0) return NS_ERROR_ABORT;
 
       int32_t startOffline;
       rv = ioParamBlock->GetInt(1, &startOffline);
       offline = NS_SUCCEEDED(rv) && startOffline == 1;
 
-      nsCOMPtr<nsIProfileLock> lock;
-      rv = dlgArray->QueryElementAt(0, NS_GET_IID(nsIProfileLock),
-                                    getter_AddRefs(lock));
+      rv = dlgArray->QueryElementAt(0, NS_GET_IID(nsIFile),
+                                    getter_AddRefs(profD));
       NS_ENSURE_SUCCESS_LOG(rv, rv);
 
-      rv = lock->GetDirectory(getter_AddRefs(profD));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      rv = lock->GetLocalDirectory(getter_AddRefs(profLD));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      lock->Unlock();
+      rv = dlgArray->QueryElementAt(1, NS_GET_IID(nsIFile),
+                                    getter_AddRefs(profLD));
+      NS_ENSURE_SUCCESS_LOG(rv, rv);
     }
   }
 
   SaveFileToEnv("XRE_PROFILE_PATH", profD);
   SaveFileToEnv("XRE_PROFILE_LOCAL_PATH", profLD);
   SaveToEnv("XRE_RESTARTED_BY_PROFILE_MANAGER=1");
 
   if (offline) {