Necko Interfaces: an Overview
Darin Fisher <darin at meer dot net>
December 10, 2001
Darin Fisher <darin at meer dot net>
December 10, 2001
nsIIOService
- central necko service
- manages protocol handlers
- thin layer over protocol handlers
- provides interface for creating URI objects from URI strings
- maps URI scheme to appropriate nsIProtocolHandler impl
- represents an URI, with getters and setters for various URI parts (eg. scheme, host, path, ...)
- per protocol implementation
- necko provides URI impl's for common URI formats (see nsStandardURL, nsSimpleURI)
- represents a logical connection to the resource identified by a nsIURI
- per protocol implementation
- single use (ie. channel is used to download the resource once)
- download initiated via nsIChannel::AsyncOpen method
- can be canceled via nsIRequest::Cancel method at anytime after invocation of AsyncOpen method
- a service that manages a protocol, identified by it's URI scheme (eg. http)
- maps URI string to nsIURI instance via NewURI method
- creates nsIChannel instance from nsIURI instance via NewChannel method
- implemented by the consumer of a nsIChannel instance
- passed to nsIChannel::AsyncOpen method
- nsIRequestObserver::OnStartRequest - notifies start of async download
- nsIStreamListener::OnDataAvailable - notifies presence of downloaded data
- nsIRequestObserver::OnStopRequest - notifies completion of async download, possibly w/ error
- attribute of a nsIRequest
- channel impl adds itself to its load group during invocation of AsyncOpen
- channel impl removes itself from its load group when download completes
- load groups in gecko own all channels used to load a particular page (until the channels complete)
- all channels owned by a load group can be canceled at once via the load group's nsIRequest::Cancel method
- represents a physical connection, such as a file descriptor or a socket
- used directly by protocol handler implementations (as well as by mailnews and chatzilla)
- synchronous I/O methods: OpenInputStream, OpenOutputStream
- asynchronous I/O methods: AsyncRead, AsyncWrite
- nsITransport::AsyncRead takes a nsIStreamListener parameter