mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 854927 - Remove callback from new async getCharsetForURI in PlacesUtils. r=mak
This commit is contained in:
parent
de0a0e8351
commit
90304860bc
@ -2128,12 +2128,10 @@ this.PlacesUtils = {
|
||||
* Gets the last saved character-set for a URI.
|
||||
*
|
||||
* @param aURI nsIURI
|
||||
* @param [optional] aCallback
|
||||
* the callback method that reruns a character-set or null.
|
||||
* @return {Promise}
|
||||
* @resolve a character-set or null.
|
||||
*/
|
||||
getCharsetForURI: function PU_getCharsetForURI(aURI, aCallback) {
|
||||
getCharsetForURI: function PU_getCharsetForURI(aURI) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
Services.tm.mainThread.dispatch(function() {
|
||||
@ -2144,11 +2142,7 @@ this.PlacesUtils = {
|
||||
PlacesUtils.CHARSET_ANNO);
|
||||
} catch (ex) { }
|
||||
|
||||
if (aCallback) {
|
||||
aCallback(charset);
|
||||
}
|
||||
deferred.resolve(charset);
|
||||
|
||||
}, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
|
||||
return deferred.promise;
|
||||
|
Loading…
Reference in New Issue
Block a user