mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 06:37:30 +09:00
Use newer asyncFetch() instead of asyncFetch2() in LWT image optimizer.
This resolves #485.
This commit is contained in:
parent
98b5fdb61b
commit
ee199e864d
1 changed files with 7 additions and 10 deletions
|
|
@ -120,22 +120,19 @@ var ImageCropper = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var ImageFile = {
|
var ImageFile = {
|
||||||
read: function ImageFile_read(aURI, aCallback) {
|
read: function(aURI, aCallback) {
|
||||||
this._netUtil.asyncFetch2(
|
this._netUtil.asyncFetch({
|
||||||
aURI,
|
uri: aURI,
|
||||||
function read_asyncFetch(aInputStream, aStatus, aRequest) {
|
loadUsingSystemPrincipal: true,
|
||||||
|
contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
|
||||||
|
}, function(aInputStream, aStatus, aRequest) {
|
||||||
if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
|
if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
|
||||||
let channel = aRequest.QueryInterface(Ci.nsIChannel);
|
let channel = aRequest.QueryInterface(Ci.nsIChannel);
|
||||||
aCallback(aInputStream, channel.contentType);
|
aCallback(aInputStream, channel.contentType);
|
||||||
} else {
|
} else {
|
||||||
aCallback();
|
aCallback();
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
null, // aLoadingNode
|
|
||||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
null, // aTriggeringPrincipal
|
|
||||||
Ci.nsILoadInfo.SEC_NORMAL,
|
|
||||||
Ci.nsIContentPolicy.TYPE_IMAGE);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
write: function ImageFile_write(aFile, aInputStream, aCallback) {
|
write: function ImageFile_write(aFile, aInputStream, aCallback) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue