Bug 474043 - Part 2 - Don't reimplement GetProtocolHandlerInfo. r=Paolo

MozReview-Commit-ID: 2gfscH2rGGB

--HG--
extra : rebase_source : 3a6e4857c7ea18a1bfb470a9b04518e9484ce696
This commit is contained in:
Marco Bonardo 2018-03-13 16:21:03 +01:00
parent afe040fd02
commit 8fb7a5e47d

View File

@ -130,22 +130,7 @@ HandlerService.prototype = {
}
for (let scheme of Object.keys(schemes)) {
// This clause is essentially a reimplementation of
// nsIExternalProtocolHandlerService.getProtocolHandlerInfo().
// Necessary because calling that from here would make XPConnect barf
// when getService tried to re-enter the constructor for this
// service.
let osDefaultHandlerFound = {};
let protoInfo = gExternalProtocolService.getProtocolHandlerInfoFromOS(scheme,
osDefaultHandlerFound);
if (this.exists(protoInfo)) {
this.fillHandlerInfo(protoInfo, null);
} else {
gExternalProtocolService.setProtocolHandlerDefaults(protoInfo,
osDefaultHandlerFound.value);
}
let protoInfo = gExternalProtocolService.getProtocolHandlerInfo(scheme);
// cache the possible handlers to avoid extra xpconnect traversals.
let possibleHandlers = protoInfo.possibleApplicationHandlers;