summaryrefslogtreecommitdiffstats
path: root/toolkit
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-06-12 14:57:51 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-06-12 14:57:51 +0200
commit518f95c2baf85a21c79d23065357f7299a021a69 (patch)
tree67370fa54691990307d69d7af954cd7e31877ba9 /toolkit
parent6df453dbfc821f8a26706c0e461fcdfcd37611c6 (diff)
downloadUXP-518f95c2baf85a21c79d23065357f7299a021a69.tar
UXP-518f95c2baf85a21c79d23065357f7299a021a69.tar.gz
UXP-518f95c2baf85a21c79d23065357f7299a021a69.tar.lz
UXP-518f95c2baf85a21c79d23065357f7299a021a69.tar.xz
UXP-518f95c2baf85a21c79d23065357f7299a021a69.zip
Use newer asyncFetch() instead of asyncFetch2() in LWT image optimizer.
This resolves #485.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm17
1 files changed, 7 insertions, 10 deletions
diff --git a/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm b/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
index 1e7d6b0d8..a5bc23ccd 100644
--- a/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
+++ b/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
@@ -120,22 +120,19 @@ var ImageCropper = {
};
var ImageFile = {
- read: function ImageFile_read(aURI, aCallback) {
- this._netUtil.asyncFetch2(
- aURI,
- function read_asyncFetch(aInputStream, aStatus, aRequest) {
+ read: function(aURI, aCallback) {
+ this._netUtil.asyncFetch({
+ uri: aURI,
+ loadUsingSystemPrincipal: true,
+ contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
+ }, function(aInputStream, aStatus, aRequest) {
if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
let channel = aRequest.QueryInterface(Ci.nsIChannel);
aCallback(aInputStream, channel.contentType);
} else {
aCallback();
}
- },
- null, // aLoadingNode
- Services.scriptSecurityManager.getSystemPrincipal(),
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_NORMAL,
- Ci.nsIContentPolicy.TYPE_IMAGE);
+ });
},
write: function ImageFile_write(aFile, aInputStream, aCallback) {