Closed Bug 1589082 Opened 5 years ago Closed 5 years ago

nsOSHelperAppService::GetProtocolHandlerInfo and GetProtocolHandlerInfoFromOS do not work in the child

Categories

(Firefox :: File Handling, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 72
Tracking Status
firefox71 --- wontfix
firefox72 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

References

Details

Attachments

(1 file)

(In reply to :Gijs (he/him) from comment #47)

While investigating bug 1586148 I'm running into a lack of information in the child, and the child version of the OS helper app service seems to have been added here. While I can work around the issue in bug 1586148, it's confusing me and we probably need a follow-up if I'm not misreading what's happening here.

Specifically, the patches [in bug 1452278] implemented nsOSHelperAppServiceChild::GetProtocolHandlerInfoFromOS as relying on nsOSHelperAppServiceChild::OSProtocolHandlerExists. But the implementation of the latter is trivial and always returns NS_ERROR_NOT_IMPLEMENTED. The former is decidedly not trivial, even has review comments in phabricator - but as far as I can tell:

NS_IMETHODIMP
nsOSHelperAppServiceChild::GetProtocolHandlerInfoFromOS(
    const nsACString& aScheme, bool* aFound, nsIHandlerInfo** aRetVal) {
  MOZ_ASSERT(!aScheme.IsEmpty(), "No scheme was specified!");

  nsresult rv =
      OSProtocolHandlerExists(PromiseFlatCString(aScheme).get(), aFound);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }

it always early returns here, because rv is always going to be NS_ERROR_NOT_IMPLEMENTED. Looks like this code meant to use nsOSHelperAppServiceChild::ExternalProtocolHandlerExists.

See Also: → 1589085
Assignee: nobody → gijskruitbosch+bugs
Priority: -- → P1

So I did a trypush to see if/when we hit this, and it doesn't look like we do in any of our browser mochitests or xpcshell tests ( https://treeherder.mozilla.org/#/jobs?repo=try&revision=fb1903bc667cccb38f0f629818cb5cd43a440c68 ). Should we just hardcode NS_ERROR_NOT_IMPLEMENTED in GetProtocolHandlerInfoFromOS and leave it like that?

Flags: needinfo?(haftandilian)

(In reply to :Gijs (he/him) from comment #1)

So I did a trypush to see if/when we hit this, and it doesn't look like we do in any of our browser mochitests or xpcshell tests ( https://treeherder.mozilla.org/#/jobs?repo=try&revision=fb1903bc667cccb38f0f629818cb5cd43a440c68 ). Should we just hardcode NS_ERROR_NOT_IMPLEMENTED in GetProtocolHandlerInfoFromOS and leave it like that?

Yes, that sounds fine to me. If we end up needing in child processes, we can add an implementation.

Flags: needinfo?(haftandilian)
No longer blocks: 1594679
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d410872412d5
make it clear we don't implement getProtocolHandlerInfoFromOS in the child service on mac, r=haik
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: