mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 22:38:41 +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 = {
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue