In order to clear cache from ChromeUtils.clearResourceCache with variuos
filtering, imgLoader needs a method that are adaptive to the current process,
where in the parent process, clear all processes' cache,
and in the content process, clear the cache in the process.
Refactored the cache methods based on single static method and single IPC
method, this is also necessary to extend the ChromeUtils.clearResourceCache in
bug 1947158.
Differential Revision: https://phabricator.services.mozilla.com/D239138