From 466d10f6fc4c28880687b96d6743ccd7fc0a24fd Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 7 Jun 2020 16:03:32 +0200 Subject: [PATCH] Remove unused methods from `NetworkManager`, in `src/display/network.js` Both of the removed methods were added in PR 2719, however they are no longer used: - It appears that `hasPendingRequests` was never used at all, even from the beginning. - The only general PDF.js library usage of `abortAllRequests` was removed in PR 6879, which is now four years ago. (Originally the Firefox-specific network implementation, see https://searchfox.org/mozilla-central/source/browser/extensions/pdfjs/content/PdfJsNetwork.jsm, was shared with the `src/display/network.js` file and *there* this method is used. However, since all of the Firefox-specific code now lives directly in mozilla-central, that's not relevant for the removal in this patch.) --- src/display/network.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/display/network.js b/src/display/network.js index 1333956bf..fc4bf9f62 100644 --- a/src/display/network.js +++ b/src/display/network.js @@ -198,13 +198,6 @@ class NetworkManager { } } - hasPendingRequests() { - for (const xhrId in this.pendingRequests) { - return true; - } - return false; - } - getRequestXhr(xhrId) { return this.pendingRequests[xhrId].xhr; } @@ -213,12 +206,6 @@ class NetworkManager { return xhrId in this.pendingRequests; } - abortAllRequests() { - for (const xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - } - abortRequest(xhrId) { const xhr = this.pendingRequests[xhrId].xhr; delete this.pendingRequests[xhrId];