Closed Bug 1596090 Opened 2 years ago Closed 2 years ago

Only send/update plugins to content when necessary, not all the time


(Core :: Plug-ins, task)

Not set



Tracking Status
firefox72 --- fixed


(Reporter: Gijs, Assigned: Gijs)




(2 files)

Bug 1592442 noticed that we read plugins.state.flash a lot under fission.

Digging into it, I remembered that I noticed some of the issue here in bug 1545123 and neglected to file a follow-up bug.

Roughly what happens here is:

  1. we start a content process and end up in ContentParent::InitInternal, which calls nsPluginHost::SendPluginsToContent
  2. nsPluginHost::SendPluginsToContent loads plugins if necessary (which itself also calls SendPluginsToContent when finished, btw), then fetches plugin information using nsPluginHost::GetPlugins()
  3. it then copies all the plugin information into serializable PluginTag instances
  4. then it iterates over all the ContentParents and sends them all the updated list.

Note that the serializable PluginTag does not include an enabled state - this is read from prefs using Preferences::GetInt(). Off-hand, I don't see why this pref changing would trigger any updates - the plugin tag instances will just start reporting their new state.

This means that in Fission, for each new per-origin process we create, we serialize the state and send it to all of the content processes. Thankfully, the ones that have already seen this list will know this because the ChromeEpoch will be the same, and skip doing much - but it'd be better to avoid the IPC traffic altogether. We can do better here by caching the list and splitting out the "update the list for all processes" and "tell this new process of the existing plugin list" responsibilities.

See Also: → 1545123
Pushed by
use staticprefs for flash enabled state pref, r=mconley
avoid sending plugin content to every content process whenever a content process is created, r=handyman
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.