bug 792825 - Crash in js::gc::MarkObjectRange on CyanogenMod 10, back out changeset 9a02263d7206 r=mossop

This commit is contained in:
Brad Lassey 2012-09-29 08:03:54 -04:00
Родитель 4d37eb758f
Коммит ef2beecd2b
3 изменённых файлов: 40 добавлений и 115 удалений

Просмотреть файл

@ -1932,26 +1932,14 @@ var AddonManagerInternal = {
}, },
get addonTypes() { get addonTypes() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return this.typesProxy; return this.typesProxy;
}, },
get autoUpdateDefault() { get autoUpdateDefault() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gAutoUpdateDefault; return gAutoUpdateDefault;
}, },
set autoUpdateDefault(aValue) { set autoUpdateDefault(aValue) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
aValue = !!aValue; aValue = !!aValue;
if (aValue != gAutoUpdateDefault) if (aValue != gAutoUpdateDefault)
Services.prefs.setBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, aValue); Services.prefs.setBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, aValue);
@ -1959,18 +1947,10 @@ var AddonManagerInternal = {
}, },
get checkCompatibility() { get checkCompatibility() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gCheckCompatibility; return gCheckCompatibility;
}, },
set checkCompatibility(aValue) { set checkCompatibility(aValue) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
aValue = !!aValue; aValue = !!aValue;
if (aValue != gCheckCompatibility) { if (aValue != gCheckCompatibility) {
if (!aValue) if (!aValue)
@ -1982,18 +1962,10 @@ var AddonManagerInternal = {
}, },
get strictCompatibility() { get strictCompatibility() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gStrictCompatibility; return gStrictCompatibility;
}, },
set strictCompatibility(aValue) { set strictCompatibility(aValue) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
aValue = !!aValue; aValue = !!aValue;
if (aValue != gStrictCompatibility) if (aValue != gStrictCompatibility)
Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, aValue); Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, aValue);
@ -2001,26 +1973,14 @@ var AddonManagerInternal = {
}, },
get checkUpdateSecurityDefault() { get checkUpdateSecurityDefault() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gCheckUpdateSecurityDefault; return gCheckUpdateSecurityDefault;
}, },
get checkUpdateSecurity() { get checkUpdateSecurity() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gCheckUpdateSecurity; return gCheckUpdateSecurity;
}, },
set checkUpdateSecurity(aValue) { set checkUpdateSecurity(aValue) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
aValue = !!aValue; aValue = !!aValue;
if (aValue != gCheckUpdateSecurity) { if (aValue != gCheckUpdateSecurity) {
if (aValue != gCheckUpdateSecurityDefault) if (aValue != gCheckUpdateSecurityDefault)
@ -2032,18 +1992,10 @@ var AddonManagerInternal = {
}, },
get updateEnabled() { get updateEnabled() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gUpdateEnabled; return gUpdateEnabled;
}, },
set updateEnabled(aValue) { set updateEnabled(aValue) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
aValue = !!aValue; aValue = !!aValue;
if (aValue != gUpdateEnabled) if (aValue != gUpdateEnabled)
Services.prefs.setBoolPref(PREF_EM_UPDATE_ENABLED, aValue); Services.prefs.setBoolPref(PREF_EM_UPDATE_ENABLED, aValue);
@ -2051,10 +2003,6 @@ var AddonManagerInternal = {
}, },
get hotfixID() { get hotfixID() {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
return gHotfixID; return gHotfixID;
}, },
}; };
@ -2392,10 +2340,6 @@ var AddonManager = {
* @return true if the addon should auto-update, false otherwise. * @return true if the addon should auto-update, false otherwise.
*/ */
shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) { shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) {
if (!gStarted)
throw Components.Exception("AddonManager is not initialized",
Cr.NS_ERROR_NOT_INITIALIZED);
if (!aAddon || typeof aAddon != "object") if (!aAddon || typeof aAddon != "object")
throw Components.Exception("aAddon must be specified", throw Components.Exception("aAddon must be specified",
Cr.NS_ERROR_INVALID_ARG); Cr.NS_ERROR_INVALID_ARG);

Просмотреть файл

@ -4,75 +4,57 @@
// Verify that API functions fail if the Add-ons Manager isn't initialised. // Verify that API functions fail if the Add-ons Manager isn't initialised.
const IGNORE = { const IGNORE = ["escapeAddonURI", "shouldAutoUpdate", "getStartupChanges",
funcs: ["escapeAddonURI", "getStartupChanges", "addTypeListener", "addTypeListener", "removeTypeListener",
"removeTypeListener", "addAddonListener", "removeAddonListener", "addAddonListener", "removeAddonListener",
"addInstallListener", "removeInstallListener", "addManagerListener", "addInstallListener", "removeInstallListener",
"removeManagerListener"], "addManagerListener", "removeManagerListener"];
getters: ["__AddonManagerInternal__"],
setters: []
};
const IGNORE_PRIVATE = { const IGNORE_PRIVATE = ["AddonAuthor", "AddonCompatibilityOverride",
funcs: ["AddonAuthor", "AddonCompatibilityOverride", "AddonScreenshot", "AddonScreenshot", "AddonType", "startup", "shutdown",
"AddonType", "startup", "shutdown", "registerProvider", "registerProvider", "unregisterProvider",
"unregisterProvider", "addStartupChange", "removeStartupChange"], "addStartupChange", "removeStartupChange"];
getters: [],
setters: []
};
function test_functions() {
for (let prop in AddonManager) {
if (typeof AddonManager[prop] != "function")
continue;
if (IGNORE.indexOf(prop) != -1)
continue;
function test_functions(aObjName, aIgnore) { try {
let obj = this[aObjName]; do_print("AddonManager." + prop);
for (let prop in obj) { AddonManager[prop]();
let desc = Object.getOwnPropertyDescriptor(obj, prop); do_throw(prop + " did not throw an exception");
}
catch (e) {
if (e.result != Components.results.NS_ERROR_NOT_INITIALIZED)
do_throw(prop + " threw an unexpected exception: " + e);
}
}
if (typeof desc.value == "function") { for (let prop in AddonManagerPrivate) {
if (aIgnore.funcs.indexOf(prop) != -1) if (typeof AddonManagerPrivate[prop] != "function")
continue; continue;
if (IGNORE_PRIVATE.indexOf(prop) != -1)
continue;
try { try {
do_print(aObjName + "." + prop + "()"); do_print("AddonManagerPrivate." + prop);
obj[prop](); AddonManagerPrivate[prop]();
do_throw(prop + " did not throw an exception"); do_throw(prop + " did not throw an exception");
} }
catch (e) { catch (e) {
if (e.result != Components.results.NS_ERROR_NOT_INITIALIZED) if (e.result != Components.results.NS_ERROR_NOT_INITIALIZED)
do_throw(prop + " threw an unexpected exception: " + e); do_throw(prop + " threw an unexpected exception: " + e);
}
} else {
if (typeof desc.get == "function" && aIgnore.getters.indexOf(prop) == -1) {
do_print(aObjName + "." + prop + " getter");
try {
let temp = obj[prop];
do_throw(prop + " did not throw an exception");
}
catch (e) {
if (e.result != Components.results.NS_ERROR_NOT_INITIALIZED)
do_throw(prop + " threw an unexpected exception: " + e);
}
}
if (typeof desc.set == "function" && aIgnore.setters.indexOf(prop) == -1) {
do_print(aObjName + "." + prop + " setter");
try {
obj[prop] = "i am the walrus";
do_throw(prop + " did not throw an exception");
}
catch (e) {
if (e.result != Components.results.NS_ERROR_NOT_INITIALIZED)
do_throw(prop + " threw an unexpected exception: " + e);
}
}
} }
} }
} }
function run_test() { function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
test_functions("AddonManager", IGNORE); test_functions();
test_functions("AddonManagerPrivate", IGNORE_PRIVATE);
startupManager(); startupManager();
shutdownManager(); shutdownManager();
test_functions("AddonManager", IGNORE); test_functions();
test_functions("AddonManagerPrivate", IGNORE_PRIVATE);
} }

Просмотреть файл

@ -18,7 +18,6 @@ function run_test() {
testserver.start(4444); testserver.start(4444);
do_test_pending(); do_test_pending();
startupManager();
run_test_1(); run_test_1();
} }