Bug 474043 - Part 2 - Don't reimplement GetProtocolHandlerInfo. r=paolo
MozReview-Commit-ID: 2gfscH2rGGB
--- a/uriloader/exthandler/nsHandlerService-json.js
+++ b/uriloader/exthandler/nsHandlerService-json.js
@@ -125,32 +125,17 @@ HandlerService.prototype = {
schemes[scheme][handlerNumber] = {};
}
schemes[scheme][handlerNumber][attribute] = attrData;
} catch (ex) {}
}
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;
for (let handlerNumber of Object.keys(schemes[scheme])) {
let handlerApp = this.handlerAppFromSerializable(schemes[scheme][handlerNumber]);
// If there is already a handler registered with the same template
// URL, the newly added one will be ignored when saving.