Bug 1864896: Autofix unused function arguments (image). r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D202968
This commit is contained in:
Dave Townsend 2024-03-03 09:09:10 +00:00
Родитель 56a01fcbcf
Коммит b53e08b713
13 изменённых файлов: 38 добавлений и 38 удалений

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

@ -15,11 +15,11 @@ var gScriptedObserver;
var gClonedRequest;
function ImageObserver(decodeCallback, discardCallback) {
this.decodeComplete = function onDecodeComplete(aRequest) {
this.decodeComplete = function onDecodeComplete() {
decodeCallback();
};
this.discard = function onDiscard(request) {
this.discard = function onDiscard() {
if (!gWaitingForDiscard) {
return;
}

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

@ -75,14 +75,14 @@ add_task(async function () {
// Returns the count of frameUpdate during |time| (in ms) period.
async function observeFrameUpdate(time) {
function ImageDecoderObserverStub() {
this.sizeAvailable = function sizeAvailable(aRequest) {};
this.frameComplete = function frameComplete(aRequest) {};
this.decodeComplete = function decodeComplete(aRequest) {};
this.loadComplete = function loadComplete(aRequest) {};
this.frameUpdate = function frameUpdate(aRequest) {};
this.discard = function discard(aRequest) {};
this.isAnimated = function isAnimated(aRequest) {};
this.hasTransparency = function hasTransparency(aRequest) {};
this.sizeAvailable = function sizeAvailable() {};
this.frameComplete = function frameComplete() {};
this.decodeComplete = function decodeComplete() {};
this.loadComplete = function loadComplete() {};
this.frameUpdate = function frameUpdate() {};
this.discard = function discard() {};
this.isAnimated = function isAnimated() {};
this.hasTransparency = function hasTransparency() {};
}
// Start from the callback of setTimeout.

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

@ -126,12 +126,12 @@ function getImagePref(pref) {
// JS implementation of imgIScriptedNotificationObserver with stubs for all of its methods.
function ImageDecoderObserverStub() {
this.sizeAvailable = function sizeAvailable(aRequest) {};
this.frameComplete = function frameComplete(aRequest) {};
this.decodeComplete = function decodeComplete(aRequest) {};
this.loadComplete = function loadComplete(aRequest) {};
this.frameUpdate = function frameUpdate(aRequest) {};
this.discard = function discard(aRequest) {};
this.isAnimated = function isAnimated(aRequest) {};
this.hasTransparency = function hasTransparency(aRequest) {};
this.sizeAvailable = function sizeAvailable() {};
this.frameComplete = function frameComplete() {};
this.decodeComplete = function decodeComplete() {};
this.loadComplete = function loadComplete() {};
this.frameUpdate = function frameUpdate() {};
this.discard = function discard() {};
this.isAnimated = function isAnimated() {};
this.hasTransparency = function hasTransparency() {};
}

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

@ -55,7 +55,7 @@ function takeReferenceSnapshot() {
"reference div should disappear when it becomes display:none");
}
function myOnFrameUpdate(aRequest) {
function myOnFrameUpdate() {
if (gIsTestFinished) {
return;
}

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

@ -101,7 +101,7 @@ function startTest(i)
element.setAttribute("scrolling", "no");
element.src = url;
document.body.appendChild(element);
function handleLoad(event)
function handleLoad()
{
iframe.loaded = true;
if (iframe == reference) {

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

@ -26,7 +26,7 @@ window.onload = function() {
.getService(SpecialPowers.Ci.nsIMemoryReporterManager);
var amount = 0;
var handleReport = function(aProcess, aPath, aKind, aUnits, aAmount, aDesc) {
var handleReport = function(aProcess, aPath, aKind, aUnits, aAmount) {
amount += aAmount;
}

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

@ -129,7 +129,7 @@ function addCallbacks(anImage) {
imgLoadingContent.addObserver(scriptedObserver);
}
function removeObserver(anImage) {
function removeObserver() {
imgLoadingContent.removeObserver(scriptedObserver);
}

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

@ -80,11 +80,11 @@ function loadNext() {
gImg.setAttribute("src", currentFile);
}
function onHasTransparency(aRequest) {
function onHasTransparency() {
gHasTransparencyWasCalled = true;
}
function onDecodeComplete(aRequest) {
function onDecodeComplete() {
if (!gCurrentFileIsTransparent) {
ok(!gHasTransparencyWasCalled,
"onHasTransparency was not called for non-transparent file " + gImg.src);

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

@ -30,7 +30,7 @@ var observer = {
throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
},
observe(subject, topic, data) {
observe(subject, topic) {
ok(topic == "net:failed-to-process-uri-content", "wrong topic");
subject = subject.QueryInterface(Ci.nsIURI);
is(subject.asciiSpec, `${location.origin}/tests/image/test/mochitest/invalid.jpg`, "wrong subject");

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

@ -45,7 +45,7 @@ function* fileToLoad() {
yield "rillybad.jpg";
}
function onSizeAvailable(aRequest) {
function onSizeAvailable() {
ok(true, "AfterLoad.onSizeAvailable called for " + gImg.src);
}
function onLoadComplete(aRequest) {
@ -68,7 +68,7 @@ function onLoadComplete(aRequest) {
}
}
function onDecodeComplete(aRequest) {
function onDecodeComplete() {
ok(gExpected > gRemovals, "AfterLoad.onDecodeComplete called for " + gImg.src);
SimpleTest.executeSoon(function() {
try {

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

@ -45,10 +45,10 @@ function* fileToLoad() {
yield "rillybad.jpg";
}
function onSizeAvailable(aRequest) {
function onSizeAvailable() {
ok(true, "AfterLoad.onSizeAvailable called for " + gImg.src);
}
function onLoadComplete(aRequest) {
function onLoadComplete() {
ok(gExpected > gLoads, "AfterLoad.onLoadComplete called for " + gImg.src);
gLoads++;
SimpleTest.executeSoon(function() {
@ -60,7 +60,7 @@ function onLoadComplete(aRequest) {
maybeAdvance();
});
}
function onDecodeComplete(aRequest) {
function onDecodeComplete() {
ok(true, "AfterLoad.onDecodeComplete called for " + gImg.src);
}

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

@ -50,7 +50,7 @@ function checkClone(other_listener, aRequest) {
// For as long as clone notification is synchronous, we can't test the clone state reliably.
var listener = new ImageListener(
null,
function (foo, bar) {
function () {
do_test_finished();
} /* getCloneStopCallback(other_listener)*/
);
@ -63,7 +63,7 @@ function checkClone(other_listener, aRequest) {
}
// Ensure that all the callbacks were called on aRequest.
function checkSizeAndLoad(listener, aRequest) {
function checkSizeAndLoad(listener) {
Assert.notEqual(listener.state & SIZE_AVAILABLE, 0);
Assert.notEqual(listener.state & LOAD_COMPLETE, 0);
@ -127,7 +127,7 @@ function checkSecondLoad() {
listener.synchronous = false;
}
function firstLoadDone(oldlistener, aRequest) {
function firstLoadDone() {
checkSecondLoad(uri);
do_test_finished();
@ -136,7 +136,7 @@ function firstLoadDone(oldlistener, aRequest) {
// Return a closure that allows us to check the stream listener's status when the
// image finishes loading.
function getChannelLoadImageStopCallback(streamlistener, next) {
return function channelLoadStop(imglistener, aRequest) {
return function channelLoadStop() {
next();
do_test_finished();
@ -216,7 +216,7 @@ function startImageCallback(otherCb) {
return function (listener, request) {
// Make sure we can load the same image immediately out of the cache.
do_test_pending();
var listener2 = new ImageListener(null, function (foo, bar) {
var listener2 = new ImageListener(null, function () {
do_test_finished();
});
var outer = Cc["@mozilla.org/image/tools;1"]

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

@ -31,12 +31,12 @@ function ImageListener(start_callback, stop_callback) {
this.start_callback(this, aRequest);
}
};
this.frameComplete = function onFrameComplete(aRequest) {
this.frameComplete = function onFrameComplete() {
Assert.ok(!this.synchronous);
this.state |= FRAME_COMPLETE;
};
this.decodeComplete = function onDecodeComplete(aRequest) {
this.decodeComplete = function onDecodeComplete() {
Assert.ok(!this.synchronous);
this.state |= DECODE_COMPLETE;
@ -50,7 +50,7 @@ function ImageListener(start_callback, stop_callback) {
this.stop_callback(this, aRequest);
}
};
this.frameUpdate = function onFrameUpdate(aRequest) {};
this.frameUpdate = function onFrameUpdate() {};
this.isAnimated = function onIsAnimated() {};
// Initialize the synchronous flag to true to start. This must be set to