When validating the name here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3350-3363 we end up here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/win/nsOSHelperAppService.cpp#475-478 and we create a new `nsMIMEInfoWin` for flatType `application/zip` because the registry doesn't know about it. Then we proceed to `FillMIMEInfoForMimeTypeFromExtras` https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3091,3101,3111,3119 and this adds the `zip` extension to the mimeInfo because of `extraMimeEntries`. Zip becomes the primary extension, being the only extension. So when we reach https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3364,3368-3369 we don't ask again to `GetFromTypeAndExtension` passing the extension too. Short, we built a mime info from scratch, and assigned it a mime type a description, and an extension. Off topic: I also noticed for the icon channel we enter GetFromTypeAndExtension with aFileExt starting with a dot, while I'd expect this method to take a dot-less extension. Maybe it could be worth spreading around some MOZ_ASSERT to those methods expecting a dot-less extension? https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#2843
Bug 1817752 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
When validating the name here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3350-3363 we end up here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/win/nsOSHelperAppService.cpp#475-478 and we create a new `nsMIMEInfoWin` for flatType `application/zip` because the registry doesn't know about it. Then we proceed to `FillMIMEInfoForMimeTypeFromExtras` https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3091,3101,3111,3119 and this adds the `zip` extension to the mimeInfo because of `extraMimeEntries`. Zip becomes the primary extension, being the only extension. So when we reach https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3364,3368-3369 we don't ask again to `GetFromTypeAndExtension` passing the extension too. Short, we built a mime info from scratch, and assigned it a mime type a description, and an extension. Off topic: I also noticed for the icon channel we enter GetFromTypeAndExtension with aFileExt starting with a dot, while I'd expect this method to take a dot-less extension. Maybe it could be worth spreading around some MOZ_ASSERT to those methods expecting a dot-less extension? https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#2843 (here we compare `zip` to `.zip`)
When validating the name here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3350-3363 we end up here https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/win/nsOSHelperAppService.cpp#475-478 and we create a new `nsMIMEInfoWin` for flatType `application/zip` because the registry doesn't know about it. Then we proceed to `FillMIMEInfoForMimeTypeFromExtras` https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3091,3101,3111,3119 and this adds the `zip` extension to the mimeInfo because of `extraMimeEntries`. Zip becomes the primary extension, being the only extension. So when we reach https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#3364,3368-3369 we have a primary extension and we don't ask again to `GetFromTypeAndExtension` with the extension. Short, we built a mime info from scratch, and assigned it a mime type a description, and an extension. Off topic: I also noticed for the icon channel we enter GetFromTypeAndExtension with aFileExt starting with a dot, while I'd expect this method to take a dot-less extension. Maybe it could be worth spreading around some MOZ_ASSERT to those methods expecting a dot-less extension? https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/uriloader/exthandler/nsExternalHelperAppService.cpp#2843 (here we compare `zip` to `.zip`)