mozilla

Revision 180608 of Necko Interfaces Overview

  • Revision slug: Necko_Interfaces_Overview
  • Revision title: Necko Interfaces Overview
  • Revision id: 180608
  • Created:
  • Creator: kohei.yoshino
  • Is current revision? No
  • Comment Migration (http://www.mozilla.org/projects/netlib/necko_interface_overview.html)

Revision Content

{{template.Outdated("It was last updated in 2001.")}}

{{template.Source("netwerk/base/public/nsIIOService.idl", "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

{{template.Source("netwerk/base/public/nsIURI.idl", "nsIURI")}} ({{template.Source("netwerk/base/public/nsIURL.idl", "nsIURL")}}, {{template.Source("netwerk/base/public/nsIFileChannel.idl", "nsIFileURL")}}, {{template.Source("netwerk/base/public/nsIURL.idl", "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 {{template.Source("netwerk/base/src/nsStandardURL.h", "nsStandardURL")}}, {{template.Source("netwerk/base/src/nsSimpleURI.h", "nsSimpleURI")}})

{{template.Source("netwerk/base/public/nsIChannel.idl", "nsIChannel")}} : {{template.Source("netwerk/base/public/nsIRequest.idl", "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

{{template.Source("netwerk/base/public/nsIProtocolHandler.idl", "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

{{template.Source("netwerk/base/public/nsIStreamListener.idl", "nsIStreamListener")}} : {{template.Source("netwerk/base/public/nsIRequestObserver.idl", "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

{{template.Source("netwerk/base/public/nsILoadGroup.idl", "nsILoadGroup")}} : {{template.Source("netwerk/base/public/nsIRequest.idl", "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

{{template.Source("netwerk/base/public/nsITransport.idl", "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


Original Document Information

  • Author(s): Darin Fisher (Netscape)
  • 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.

Revision Source

<p>{{template.Outdated("It was last updated in 2001.")}}
</p>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsIIOService.idlnsIIOService"> {{template.Source("netwerk/base/public/nsIIOService.idl", "nsIIOService")}} </h3>
<ul><li> central necko service
</li><li> manages protocol handlers
</li><li> thin layer over protocol handlers
</li><li> provides interface for creating URI objects from URI strings
</li><li> maps URI scheme to appropriate nsIProtocolHandler impl
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsIURI.idlnsIURI_.28Sourcenetwerk.2Fbase.2Fpublic.2FnsIURL.idlnsIURL.2C_Sourcenetwerk.2Fbase.2Fpublic.2FnsIFileChannel.idlnsIFileURL.2C_Sourcenetwerk.2Fbase.2Fpublic.2FnsIURL.idlnsIStandardURL.29"> {{template.Source("netwerk/base/public/nsIURI.idl", "nsIURI")}} ({{template.Source("netwerk/base/public/nsIURL.idl", "nsIURL")}}, {{template.Source("netwerk/base/public/nsIFileChannel.idl", "nsIFileURL")}}, {{template.Source("netwerk/base/public/nsIURL.idl", "nsIStandardURL")}}) </h3>
<ul><li> represents an URI, with getters and setters for various URI parts (eg. scheme, host, path, ...)
</li><li> per protocol implementation
</li><li> necko provides URI impl's for common URI formats (see {{template.Source("netwerk/base/src/nsStandardURL.h", "nsStandardURL")}}, {{template.Source("netwerk/base/src/nsSimpleURI.h", "nsSimpleURI")}})
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsIChannel.idlnsIChannel_:_Sourcenetwerk.2Fbase.2Fpublic.2FnsIRequest.idlnsIRequest"> {{template.Source("netwerk/base/public/nsIChannel.idl", "nsIChannel")}} : {{template.Source("netwerk/base/public/nsIRequest.idl", "nsIRequest")}} </h3>
<ul><li> represents a logical connection to the resource identified by a nsIURI
</li><li> per protocol implementation
</li><li> single use (ie. channel is used to download the resource <i>once</i>)
</li><li> download initiated via nsIChannel::AsyncOpen method
</li><li> can be canceled via nsIRequest::Cancel method at anytime after invocation of AsyncOpen method
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsIProtocolHandler.idlnsIProtocolHandler"> {{template.Source("netwerk/base/public/nsIProtocolHandler.idl", "nsIProtocolHandler")}} </h3>
<ul><li> a service that manages a protocol, identified by it's URI scheme (eg. http)
</li><li> maps URI string to nsIURI instance via NewURI method
</li><li> creates nsIChannel instance from nsIURI instance via NewChannel method
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsIStreamListener.idlnsIStreamListener_:_Sourcenetwerk.2Fbase.2Fpublic.2FnsIRequestObserver.idlnsIRequestObserver"> {{template.Source("netwerk/base/public/nsIStreamListener.idl", "nsIStreamListener")}} : {{template.Source("netwerk/base/public/nsIRequestObserver.idl", "nsIRequestObserver")}} </h3>
<ul><li> implemented by the consumer of a nsIChannel instance
</li><li> passed to nsIChannel::AsyncOpen method
</li><li> nsIRequestObserver::OnStartRequest - notifies start of async download
</li><li> nsIStreamListener::OnDataAvailable - notifies presence of downloaded data
</li><li> nsIRequestObserver::OnStopRequest - notifies completion of async download, possibly w/ error
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsILoadGroup.idlnsILoadGroup_:_Sourcenetwerk.2Fbase.2Fpublic.2FnsIRequest.idlnsIRequest"> {{template.Source("netwerk/base/public/nsILoadGroup.idl", "nsILoadGroup")}} : {{template.Source("netwerk/base/public/nsIRequest.idl", "nsIRequest")}} </h3>
<ul><li> attribute of a nsIRequest
</li><li> channel impl adds itself to its load group during invocation of AsyncOpen
</li><li> channel impl removes itself from its load group when download completes
</li><li> load groups in gecko own all channels used to load a particular page (until the channels complete)
</li><li> all channels owned by a load group can be canceled at once via the load group's nsIRequest::Cancel method
</li></ul>
<h3 name="Sourcenetwerk.2Fbase.2Fpublic.2FnsITransport.idlnsITransport"> {{template.Source("netwerk/base/public/nsITransport.idl", "nsITransport")}} </h3>
<ul><li> represents a physical connection, such as a file descriptor or a socket
</li><li> used directly by protocol handler implementations (as well as by mailnews and chatzilla)
</li><li> synchronous I/O methods: OpenInputStream, OpenOutputStream
</li><li> asynchronous I/O methods: AsyncRead, AsyncWrite
</li><li> nsITransport::AsyncRead takes a nsIStreamListener parameter
</li></ul>
<p><br>
</p>
<div class="originaldocinfo">
<h2 name="Original_Document_Information"> Original Document Information </h2>
<ul><li> Author(s): Darin Fisher (Netscape)
</li><li> Last Updated Date: December 10, 2001
</li><li> Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | <a class="external" href="http://www.mozilla.org/foundation/licensing/website-content.html">Details</a>.
</li></ul>
</div>
Revert to this revision