chrome/browser/web_applications/jobs/README.md
chrome/browser/web_applications/jobs)This directory contains reusable units of work, referred to as "jobs".
While Commands are scheduled by the
WebAppCommandScheduler and orchestrate the high-level workflow of web app
operations (such as "Fetch Manifest and Install"), these workflows often share
common steps (e.g., "Install from info", "Perform an update", "Transform a
manifest into a WebAppInstallInfo", etc).
Jobs extract these common steps so they can be reused across different commands.
WebAppCommandScheduler. A command must own and execute the job.JobResult type to the owning
command via a callback.CreateAndStart static factory method
that returns a std::unique_ptr to the job.raw_refs. To be flexible, use the lock mixin type (like WithAppResources)
instead of the concrete lock class (e.g. AppLock).raw_ref/raw_ptr in the job doesn't flag a dangling pointer issue when the
command is destroyed (since the command owns the lock).