consider making aFileExt the primary extension if it is an extension

RESOLVED FIXED in mozilla1.5beta

Status

P3
normal
RESOLVED FIXED
15 years ago
2 years ago

People

(Reporter: Biesinger, Assigned: Biesinger)

Tracking

Trunk
mozilla1.5beta

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

bz mentioned this in bug 147679 comment 41:
"Do we want to list anything here as far as the return value?  Like
that we guarantee the return value will have [...] aFileExt as the
primaryExtension if that's a valid
extension for aMIMEType?"

After thinking about this some, and seeing the callers, I agree that this would
be a good idea.

This would basically include moving this code:
  PRBool matches = PR_FALSE;
  if (!fileExtension.IsEmpty()) {
    mimeInfo->ExtensionExists(fileExtension.get(), &matches);
  }
  if (matches) {
    mimeInfo->SetPrimaryExtension(fileExtension.get());
  }
from nsExternalHelperAppService::DoContent to GetFromTypeAndExtension

and it would allow changing that part of the code in DoContent to just
"mimeInfo->GetPrimaryExtension(getter_Copies(fileExtension))"
*** Bug 213893 has been marked as a duplicate of this bug. ***
*** Bug 213892 has been marked as a duplicate of this bug. ***
*** Bug 213887 has been marked as a duplicate of this bug. ***
*** Bug 213883 has been marked as a duplicate of this bug. ***
*** Bug 213884 has been marked as a duplicate of this bug. ***
*** Bug 213885 has been marked as a duplicate of this bug. ***
*** Bug 213888 has been marked as a duplicate of this bug. ***
*** Bug 213889 has been marked as a duplicate of this bug. ***
*** Bug 213890 has been marked as a duplicate of this bug. ***
*** Bug 213891 has been marked as a duplicate of this bug. ***
Attachment #128523 - Flags: review?(bzbarsky)
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.5beta
Comment on attachment 128523 [details] [diff] [review]
patch

Looks good.
Attachment #128523 - Flags: review?(bzbarsky) → review+
Attachment #128523 - Flags: superreview?(darin)

Comment 13

15 years ago
how did all those duplicates get posted? :P

Updated

15 years ago
Attachment #128523 - Flags: superreview?(darin) → superreview+
Checking in nsExternalHelperAppService.cpp;
/cvsroot/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp,v  <-- 
nsExternalHelperAppService.cpp
new revision: 1.206; previous revision: 1.205
done
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.