This page contains some notes on how plugins work internally in Gecko. It is mainly of interest to Gecko developers.

Note: This document documents how trunk works, i.e. Gecko 1.9. No released product uses this specific architecture.

Note: This document describes how things are, not necessarily how things should be. It is not set in stone. Do not use this document for deciding what plugins can rely on. The described sequences are subject to change at any time.

Classes

There are some classes involved in plugins:

Note that while nsObjectLoadingContent also deals with images and documents, this document concentrates on plugins.

Sequence of events

In content

That was the normal case. If a frame comes into existance independent of that, it tells the content node that it exists now (nsIObjectLoadingContent::hasNewFrame). That function will post an event and when that fires, asks the frame to instantiate the plugin. (The event is necessary because by the time HasNewFrame is called, the frame isn't fully set up yet)


In layout

Note: Some of this should move to content