Commit f7f0fc82 authored by Tristan Cavelier's avatar Tristan Cavelier

blobAsBinaryString renamed to readBlobAsBinaryString

parent 7982a0ac
...@@ -324,21 +324,15 @@ function makeBinaryStringDigest(string) { ...@@ -324,21 +324,15 @@ function makeBinaryStringDigest(string) {
} }
exports.util.makeBinaryStringDigest = makeBinaryStringDigest; exports.util.makeBinaryStringDigest = makeBinaryStringDigest;
function blobAsBinaryString(blob) { function readBlobAsBinaryString(blob) {
var deferred = new Deferred(), fr = new FileReader(); var deferred = new Deferred(), fr = new FileReader();
fr.onload = function () { fr.onload = deferred.resolve.bind(deferred);
deferred.resolve(fr.result); fr.onerror = deferred.reject.bind(deferred);
}; fr.onprogress = deferred.notify.bind(deferred);
fr.onerror = function () {
deferred.reject(); // XXX
};
fr.onprogress = function () {
deferred.notify(); // XXX
};
fr.readAsBinaryString(blob); fr.readAsBinaryString(blob);
return deferred.promise(); return deferred.promise();
} }
exports.util.blobAsBinaryString = blobAsBinaryString; exports.util.readBlobAsBinaryString = readBlobAsBinaryString;
/** /**
* Acts like `Array.prototype.concat` but does not create a copy of the original * Acts like `Array.prototype.concat` but does not create a copy of the original
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment