Necko Interfaces Overview 编辑

Warning: The content of this article may be out of date. It was last updated in 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

nsIURI (nsIURL, nsIFileURL, nsIStandardURL)

  • 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)

nsIChannel : nsIRequest

  • 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

nsIProtocolHandler

  • 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

nsIStreamListener : nsIRequestObserver

  • 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

nsILoadGroup : nsIRequest

  • 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

Original Document Information

nsITransport

  • 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


  • Author(s): Darin Fisher
  • Last Updated Date: December 10, 2001
  • Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:62 次

字数:5456

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文