mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1287143
- Remove the window argument to SpecialPowers.exactGC(). r=jmaher
Cu.forceCC() is the same as DOMWindowUtils.cycleCollect(), but does not require a window.
This commit is contained in:
parent
332fcd9fc9
commit
623b56a3f1
@ -87,7 +87,7 @@ add_task(function* () {
|
||||
|
||||
function waitForDestroyedDocuments() {
|
||||
let deferred = promise.defer();
|
||||
SpecialPowers.exactGC(window, deferred.resolve);
|
||||
SpecialPowers.exactGC(deferred.resolve);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=889335
|
||||
document.body.removeChild(frame);
|
||||
frame = null;
|
||||
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
// This should not crash.
|
||||
SpecialPowers.pushPrefEnv({"set": [['intl.accept_languages', 'en-GB']]}, nextTest);
|
||||
});
|
||||
|
@ -29,7 +29,7 @@ function callback() {
|
||||
}
|
||||
|
||||
delete window.XMLHttpRequestUpload;
|
||||
SpecialPowers.exactGC(window, callback);
|
||||
SpecialPowers.exactGC(callback);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -54,7 +54,7 @@ function resetStorage() {
|
||||
|
||||
function gc() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
SpecialPowers.exactGC(window, resolve);
|
||||
SpecialPowers.exactGC(resolve);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ function resetStorage() {
|
||||
|
||||
function gc() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
SpecialPowers.exactGC(window, resolve);
|
||||
SpecialPowers.exactGC(resolve);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ function resetStorage() {
|
||||
|
||||
function gc() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
SpecialPowers.exactGC(window, resolve);
|
||||
SpecialPowers.exactGC(resolve);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ function gc()
|
||||
|
||||
function scheduleGC()
|
||||
{
|
||||
SpecialPowers.exactGC(window, continueToNextStep);
|
||||
SpecialPowers.exactGC(continueToNextStep);
|
||||
}
|
||||
|
||||
function workerScript() {
|
||||
|
@ -217,7 +217,7 @@ function gc()
|
||||
|
||||
function scheduleGC()
|
||||
{
|
||||
SpecialPowers.exactGC(null, continueToNextStep);
|
||||
SpecialPowers.exactGC(continueToNextStep);
|
||||
}
|
||||
|
||||
function setTimeout(fun, timeout) {
|
||||
@ -492,7 +492,7 @@ var SpecialPowers = {
|
||||
this._getPrefs().clearUserPref(prefName);
|
||||
},
|
||||
// Copied (and slightly adjusted) from specialpowersAPI.js
|
||||
exactGC: function(win, callback) {
|
||||
exactGC: function(callback) {
|
||||
let count = 0;
|
||||
|
||||
function doPreciseGCandCC() {
|
||||
|
@ -1665,7 +1665,7 @@ function mediaTestCleanup(callback) {
|
||||
removeNodeAndSource(A[i]);
|
||||
A[i] = null;
|
||||
}
|
||||
SpecialPowers.exactGC(window, callback);
|
||||
SpecialPowers.exactGC(callback);
|
||||
}
|
||||
|
||||
function setMediaTestsPrefs(callback, extraPrefs) {
|
||||
|
@ -20,7 +20,7 @@ function doTest() {
|
||||
v.onended = function() {
|
||||
info("Got ended.");
|
||||
v.onended = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
info("GC completed.");
|
||||
v.play();
|
||||
SimpleTest.finish();
|
||||
|
@ -324,7 +324,7 @@ function setupEnvironment() {
|
||||
|
||||
// We don't care about waiting for this to complete, we just want to ensure
|
||||
// that we don't build up a huge backlog of GC work.
|
||||
SpecialPowers.exactGC(window);
|
||||
SpecialPowers.exactGC();
|
||||
}
|
||||
|
||||
// This is called by steeplechase; which provides the test configuration options
|
||||
|
@ -55,7 +55,7 @@ add_task(function*() {
|
||||
ok(time < 1000, "Interval is not throttled with audio playing (" + time + " ms)");
|
||||
|
||||
// Destroy the oscillator, but not the audio context
|
||||
yield new Promise(resolve => SpecialPowers.exactGC(browser.contentWindow, resolve));
|
||||
yield new Promise(resolve => SpecialPowers.exactGC(resolve));
|
||||
yield oscillatorDemisePromise;
|
||||
|
||||
time = yield ContentTask.spawn(browser, null, function () {
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
function gc() {
|
||||
return new Promise(function(resolve) {
|
||||
SpecialPowers.exactGC(window, resolve);
|
||||
SpecialPowers.exactGC(resolve);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
// properly store and retrieve the security info from the cache.
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
iframe = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
iframe = document.createElement("iframe");
|
||||
iframe.src = "https://example.com/tests/dom/workers/test/serviceworkers/fetch/https/synth.html";
|
||||
document.body.appendChild(iframe);
|
||||
|
@ -23,7 +23,7 @@
|
||||
iframe.src = "about:blank";
|
||||
document.body.removeChild(iframe);
|
||||
iframe = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
resolve(result);
|
||||
});
|
||||
};
|
||||
|
@ -59,7 +59,7 @@
|
||||
iframe.src = "about:blank";
|
||||
document.body.removeChild(iframe);
|
||||
iframe = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
resolve(message.data);
|
||||
});
|
||||
};
|
||||
|
@ -58,7 +58,7 @@
|
||||
iframe.src = "about:blank";
|
||||
document.body.removeChild(iframe);
|
||||
iframe = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
SpecialPowers.exactGC(function() {
|
||||
resolve(message.data);
|
||||
});
|
||||
};
|
||||
|
@ -113,7 +113,7 @@
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
info("Running GC");
|
||||
SpecialPowers.exactGC(window, sendToGenerator);
|
||||
SpecialPowers.exactGC(sendToGenerator);
|
||||
yield undefined;
|
||||
|
||||
info("Waiting the event queue to clear");
|
||||
|
@ -29,6 +29,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=484459
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SpecialPowers.exactGC(window, callback);
|
||||
SpecialPowers.exactGC(callback);
|
||||
]]></script>
|
||||
</window>
|
||||
|
@ -1489,13 +1489,12 @@ SpecialPowersAPI.prototype = {
|
||||
// needs to run several times and when no other JS is running.
|
||||
// The current number of iterations has been determined according to massive
|
||||
// cross platform testing.
|
||||
exactGC: function(win, callback) {
|
||||
var self = this;
|
||||
exactGC: function(callback) {
|
||||
let count = 0;
|
||||
|
||||
function genGCCallback(cb) {
|
||||
return function() {
|
||||
self.getDOMWindowUtils(win).cycleCollect();
|
||||
Cu.forceCC();
|
||||
if (++count < 2) {
|
||||
Cu.schedulePreciseGC(genGCCallback(cb));
|
||||
} else if (cb) {
|
||||
|
Loading…
Reference in New Issue
Block a user