Firefox/Projects/Async Annotation Protocol Handler
From MozillaWiki
Overview
Sprint lead: sdwilsh
Sprinters: dietrich, bz
- Description
- Get more file IO off the the main thread by making the annotation protocol handler asynchronous.
Goals / Use Cases
- Reduce file IO on the main thread by handling the primary consumer of the annotation protocol - favicons
Non Goals
- Reduce file IO for other types of annotations. Sadly, this would require an API change, and is therefore out of scope for Firefox 3.1
Design
We want to use NS_NewPipe, and pass the output stream to our async callback to the database. For the segment size, we want to pass MAX_FAVICON_SIZE, since any favicon that is larger we will optimize to a smaller size. When the database gets data, it will write that data to the output stream. When we want push that data to the output stream, we should call write. Everything else will be handled by the networking code.