Closed Bug 282958 Opened 20 years ago Closed 17 years ago

toolkit/mozapps/downloads/content uses wrong contractid for the MIME service

Categories

(Core Graveyard :: File Handling, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: Biesinger, Assigned: chpe)

References

()

Details

(Whiteboard: [good first bug])

Attachments

(1 file, 2 obsolete files)

toolkit/mozapps/downloads/content uses
"@mozilla.org/uriloader/external-helper-app-service;1" where
"@mozilla.org/mime;1" would be correct, since the code just cares about the mime
service functionality.
Note that this is particularly a problem if an extension wants to drop in a
better MIME service....  It can override "@mozilla.org/mime;1" without too much
trouble, whereas overriding the other contractid is a pain (since it's used from
inside uriloader and takes a lot more effort to do right).
QA Contact: ali → download.manager
Assignee: bugs → nobody
Version: unspecified → Trunk
Whiteboard: [good first bug]
Attached patch patch (obsolete) — Splinter Review
I'm not sure we want to change *all* of those.
Sure looks to me like you do, if all you use them for is nsIMIMEService.
All those files only call methods from nsIMIMService on them, so I think switching them all should be fine.

I discovered one more place that might need to change: nsExternalHelperAppService.cpp::DoContent calls GetFromTypeAndExtension. That's a nsIMIMEService method, but it calls it on itself (the same class is implementing the nsIMIMService). I think to make nsIMIMService really replaceable, these need to be switched to get the MIME service by its contract and use that, right?
Yeah, that would probably need to happen.
Attached patch updated patch (obsolete) — Splinter Review
Attachment #286145 - Attachment is obsolete: true
Attachment #288136 - Flags: review?(cbiesinger)
Comment on attachment 288136 [details] [diff] [review]
updated patch

+  nsCOMPtr<nsIMIMEService> mimeSvc (do_GetService (NS_MIMESERVICE_CONTRACTID));

please remove the two spaces here
Attachment #288136 - Flags: review?(cbiesinger) → review+
Assignee: nobody → chpe
Component: Download Manager → File Handling
Product: Firefox → Core
QA Contact: download.manager → file-handling
Comment on attachment 289477 [details] [diff] [review]
final patch: remove those spaces

Fixes several uses of the mime service that were using the wrong contract ID to refer to it.
Attachment #289477 - Flags: approval1.9?
Note that I asked gavin if he thought somebody from toolkit/browser/etc. should review it, and he said that biesi's review should be enough, since the only change is fixing the contract ID.
Attachment #289477 - Flags: approval1.9? → approval1.9+
Checking in uriloader/exthandler/nsExternalHelperAppService.cpp;
/cvsroot/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp,v  <--  nsExternalHelperAppService.cpp
new revision: 1.356; previous revision: 1.355
done
Checking in uriloader/exthandler/nsHandlerService.js;
/cvsroot/mozilla/uriloader/exthandler/nsHandlerService.js,v  <--  nsHandlerService.js
new revision: 1.16; previous revision: 1.15
done
Checking in toolkit/mozapps/downloads/content/downloads.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/downloads.js,v  <--  downloads.js
new revision: 1.103; previous revision: 1.102
done
Checking in toolkit/mozapps/downloads/content/helperApps.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/helperApps.js,v  <--  helperApps.js
new revision: 1.13; previous revision: 1.12
done
Checking in toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in;
/cvsroot/mozilla/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in,v  <--  nsHelperAppDlg.js.in
new revision: 1.58; previous revision: 1.57
done
Checking in mail/components/preferences/downloadactions.js;
/cvsroot/mozilla/mail/components/preferences/downloadactions.js,v  <--  downloadactions.js
new revision: 1.6; previous revision: 1.5
done
Checking in uriloader/exthandler/tests/unit/test_handlerService.js;
/cvsroot/mozilla/uriloader/exthandler/tests/unit/test_handlerService.js,v  <--  test_handlerService.js
new revision: 1.14; previous revision: 1.13
done
Checking in browser/components/preferences/applications.js;
/cvsroot/mozilla/browser/components/preferences/applications.js,v  <--  applications.js
new revision: 1.28; previous revision: 1.27
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
Any potential impact on Thunderbird here.
Why I raise the issue, is that I see no effect of mime type on plugin instantiation or calling a helper app in windows TB. Seems the file extension prevails.
(In reply to comment #13)
> Any potential impact on Thunderbird here.
> Why I raise the issue, is that I see no effect of mime type on plugin
> instantiation or calling a helper app in windows TB. Seems the file extension
> prevails.

This patch shouldn't have any effect, since it only changes from which contract ID the MIME service is accessed.

Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: