extensions/docs/overview.md
This document is an overview of extensions concepts, terms, and architecture. The target audience is engineers working on extension support code in the browser, not extension authors. See also the public extensions documentation.
An instance of class Extension represents a single installed extension.
Instances of this class are mostly immutable, and are often passed around as
scoped_refptr<const Extension>.
An instance of this class represents the manifest of an Extension. An Extension has (and owns) exactly one Manifest. The Manifest contains the parsed JSON data from an extension's manifest.json.
An instance of this class manages much of the state needed to manipulate and use extensions. It controls many subsidiary services and controllers. It also contains an extensions::ExtensionService, which is a mostly-historical grab bag that is still used for many operations.
TODO(ellyjones): Move this to a separate manifest.md doc?
These two cooperating classes allow for manifest parsing to be modular. An
instance of ManifestHandler receives the manifest and parses data out of it as
desired, attaching data to the Extension in question via
extensions::Extension::SetManifestData. If you were adding a new field to the
manifest, you would:
extensions::RegisterChromeManifestHandlersextensions::Extension::GetManifestData as needed. Conventionally, one adds
a static method to the ManifestData subclass from (1) to retrieve it from an
Extension.TODO(ellyjones): How does extension sync work?
TODO(ellyjones): Write some words!