Skip to content

Commit

Permalink
Backed out changeset d744fed63a45 (bug 1744243) for causing xpc failu…
Browse files Browse the repository at this point in the history
…res in test_URIFixup_external_protocol_fallback. CLOSED TREE
  • Loading branch information
Sandor Molnar committed Aug 9, 2022
1 parent 8efdb3c commit 087b91b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 127 deletions.
27 changes: 2 additions & 25 deletions docshell/base/URIFixup.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ XPCOMUtils.defineLazyServiceGetter(
"nsIDNSService"
);

XPCOMUtils.defineLazyServiceGetter(
lazy,
"handlerService",
"@mozilla.org/uriloader/handler-service;1",
"nsIHandlerService"
);

XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"fixupSchemeTypos",
Expand Down Expand Up @@ -266,15 +259,7 @@ XPCOMUtils.defineLazyGetter(lazy, "knownSuffixes", () => {
return suffixes;
});

function URIFixup() {
// There are cases that nsIExternalProtocolService.externalProtocolHandlerExists() does
// not work well and returns always true due to flatpak. In this case, in order to
// fallback to nsIHandlerService.exits(), we test whether can trust
// nsIExternalProtocolService here.
this._trustExternalProtocolService = !lazy.externalProtocolService.externalProtocolHandlerExists(
`__dummy${Date.now()}__`
);
}
function URIFixup() {}

URIFixup.prototype = {
get FIXUP_FLAG_NONE() {
Expand Down Expand Up @@ -344,7 +329,7 @@ URIFixup.prototype = {
scheme &&
(isCommonProtocol ||
Services.io.getProtocolHandler(scheme) != lazy.defaultProtocolHandler ||
this._isKnownExternalProtocol(scheme));
lazy.externalProtocolService.externalProtocolHandlerExists(scheme));

if (
canHandleProtocol ||
Expand Down Expand Up @@ -646,14 +631,6 @@ URIFixup.prototype = {

isDomainKnown,

_isKnownExternalProtocol(scheme) {
return this._trustExternalProtocolService
? lazy.externalProtocolService.externalProtocolHandlerExists(scheme)
: lazy.handlerService.exists(
lazy.externalProtocolService.getProtocolHandlerInfo(scheme)
);
},

classID: Components.ID("{c6cf88b7-452e-47eb-bdc9-86e3561648ef}"),
QueryInterface: ChromeUtils.generateQI(["nsIURIFixup"]),
};
Expand Down
100 changes: 0 additions & 100 deletions docshell/test/unit/test_URIFixup_external_protocol_fallback.js

This file was deleted.

3 changes: 1 addition & 2 deletions docshell/test/unit/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ support-files =
[test_browsing_context_structured_clone.js]
[test_URIFixup.js]
[test_URIFixup_check_host.js]
[test_URIFixup_external_protocol_fallback.js]
[test_URIFixup_forced.js]
# Disabled for 1563343 -- URI fixup should be done at the app level in GV.
skip-if = os == 'android'
Expand All @@ -25,6 +24,6 @@ skip-if =
skip-if = true
[test_privacy_transition.js]
[test_subframe_stop_after_parent_error.js]
skip-if =
skip-if =
os == 'android'
appname == 'thunderbird' # Needs to run without E10s, can't do that.

0 comments on commit 087b91b

Please sign in to comment.