Closed Bug 881578 Opened 11 years ago Closed 11 years ago

Add JSM to hardcoded extensions/mime type list

Categories

(Core Graveyard :: File Handling, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla24

People

(Reporter: vladan, Assigned: vladan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The MIME type of the .JSM extension isn't hardcoded, so the first time Firefox loads a JSM, it has to initialize the plugin list (nsPluginHost::LoadPlugins) to try to figure out the file's MIME type. This is not the case for .JS files.

It is expensive to initialize the plugin list since it involves stat'ing lots of plugin directories and libraries on the main thread during startup.
Attachment #760681 - Flags: review?(ehsan)
Comment on attachment 760681 [details] [diff] [review]
Hardcode the MIME-type of .JSM files

Review of attachment 760681 [details] [diff] [review]:
-----------------------------------------------------------------

::: uriloader/exthandler/nsExternalHelperAppService.cpp
@@ +466,5 @@
>    { "application/rtf", "rtf", "Rich Text Format File" },
>    { APPLICATION_XPINSTALL, "xpi", "XPInstall Install" },
>    { APPLICATION_POSTSCRIPT, "ps,eps,ai", "Postscript File" },
>    { APPLICATION_XJAVASCRIPT, "js", "Javascript Source File" },
> +  { APPLICATION_XJAVASCRIPT, "jsm", "Javascript Source File" },

Now that you actually asked for my review, here's a nit!

"Javascript Module Source File"
Attachment #760681 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/b6805a18ea30
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.