Last Comment Bug 881578 - Add JSM to hardcoded extensions/mime type list
: Add JSM to hardcoded extensions/mime type list
Status: RESOLVED FIXED
:
Product: Core Graveyard
Classification: Graveyard
Component: File Handling (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla24
Assigned To: Vladan Djeric (:vladan)
:
:
Mentors:
Depends on:
Blocks: start-faster
  Show dependency treegraph
 
Reported: 2013-06-10 18:29 PDT by Vladan Djeric (:vladan)
Modified: 2016-06-22 12:16 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Hardcode the MIME-type of .JSM files (1.30 KB, patch)
2013-06-10 18:29 PDT, Vladan Djeric (:vladan)
ehsan: review+
Details | Diff | Splinter Review

Description Vladan Djeric (:vladan) 2013-06-10 18:29:02 PDT
Created attachment 760681 [details] [diff] [review]
Hardcode the MIME-type of .JSM files

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.
Comment 1 Vladan Djeric (:vladan) 2013-06-10 18:29:41 PDT
https://tbpl.mozilla.org/?tree=Try&rev=4d912c911063
Comment 2 :Ehsan Akhgari 2013-06-10 18:35:24 PDT
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"
Comment 4 Ed Morley [:emorley] 2013-06-11 01:40:05 PDT
https://hg.mozilla.org/mozilla-central/rev/b6805a18ea30

Note You need to log in before you can comment on or make changes to this bug.