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
parent 56a01fcbcf
commit b53e08b713
13 changed files with 38 additions and 38 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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