зеркало из https://github.com/mozilla/gecko-dev.git
Bug 745154 - Disable automatic safe mode after startup crashes in debug builds or using an environment variable (r=ehsan)
This commit is contained in:
Родитель
4cef91ed01
Коммит
c6a1c4ab1a
|
@ -89,6 +89,7 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
|
|||
#define kPrefLastSuccess "toolkit.startup.last_success"
|
||||
#define kPrefMaxResumedCrashes "toolkit.startup.max_resumed_crashes"
|
||||
#define kPrefRecentCrashes "toolkit.startup.recent_crashes"
|
||||
#define kPrefAlwaysUseSafeMode "toolkit.startup.always_use_safe_mode"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#include "mozilla/perfprobe.h"
|
||||
|
@ -831,6 +832,17 @@ nsAppStartup::GetAutomaticSafeModeNecessary(bool *_retval)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
bool alwaysSafe = false;
|
||||
Preferences::GetBool(kPrefAlwaysUseSafeMode, &alwaysSafe);
|
||||
|
||||
if (!alwaysSafe) {
|
||||
#if DEBUG
|
||||
mIsSafeModeNecessary = false;
|
||||
#else
|
||||
mIsSafeModeNecessary &= !PR_GetEnv("MOZ_DISABLE_AUTO_SAFE_MODE");
|
||||
#endif
|
||||
}
|
||||
|
||||
*_retval = mIsSafeModeNecessary;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -15,8 +15,11 @@ let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
|
|||
const pref_last_success = "toolkit.startup.last_success";
|
||||
const pref_recent_crashes = "toolkit.startup.recent_crashes";
|
||||
const pref_max_resumed_crashes = "toolkit.startup.max_resumed_crashes";
|
||||
const pref_always_use_safe_mode = "toolkit.startup.always_use_safe_mode";
|
||||
|
||||
function run_test() {
|
||||
prefService.setBoolPref(pref_always_use_safe_mode, true);
|
||||
|
||||
resetTestEnv(0);
|
||||
|
||||
test_trackStartupCrashBegin();
|
||||
|
@ -25,6 +28,8 @@ function run_test() {
|
|||
test_trackStartupCrashEnd_safeMode();
|
||||
test_maxResumed();
|
||||
resetTestEnv(0);
|
||||
|
||||
prefService.clearUserPref(pref_always_use_safe_mode);
|
||||
}
|
||||
|
||||
// reset prefs to default
|
||||
|
|
Загрузка…
Ссылка в новой задаче