Closed Bug 1596090 Opened 5 months ago Closed 4 months ago

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

Categories

(Core :: Plug-ins, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

References

Details

Attachments

(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 gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/df333402f126
use staticprefs for flash enabled state pref, r=mconley
https://hg.mozilla.org/integration/autoland/rev/74ac84aa60fd
avoid sending plugin content to every content process whenever a content process is created, r=handyman
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.