Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
nsIOService Class Reference

#include <nsIOService.h>

Inheritance diagram for nsIOService:
Inheritance graph
[legend]
Collaboration diagram for nsIOService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NS_HIDDEN_ (nsresult) Init()
 NS_HIDDEN_ (nsresult) NewURI(const char *aSpec
nsresult OnChannelRedirect (nsIChannel *oldChan, nsIChannel *newChan, PRUint32 flags)
const nsCOMArray
< nsIContentSniffer_MOZILLA_1_8_BRANCH > & 
GetContentSniffers ()
nsIProtocolHandler getProtocolHandler (in string aScheme)
 Returns a protocol handler for a given URI scheme.
unsigned long getProtocolFlags (in string aScheme)
 Returns the protocol flags for a given scheme.
nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI)
 This method constructs a new URI by determining the scheme of the URI spec, and then delegating the construction of the URI to the protocol handler for that scheme.
nsIURI newFileURI (in nsIFile aFile)
 This method constructs a new URI from a nsIFile.
nsIChannel newChannelFromURI (in nsIURI aURI)
 Creates a channel for a given URI.
nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI)
 Equivalent to newChannelFromURI(newURI(...))
boolean allowPort (in long aPort, in string aScheme)
 Checks if a port number is banned.
ACString extractScheme (in AUTF8String urlString)
 Utility to extract the scheme from a URL string, consistently and according to spec (see RFC 2396).
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.
AUTF8String parseContentType (in AUTF8String aTypeHeader, out AUTF8String aCharset, out boolean aHadCharset)
 Parse a content-type header and return the content type and charset (if any).

Static Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIIOSERVICE
NS_DECL_NSIIOSERVICE2
NS_DECL_NSIOBSERVER static
NS_DECL_NSINETUTIL nsIOService
GetInstance ()

Public Attributes

nsIURIaBaseURI
nsIURI nsIURI ** result
nsIURI nsIURI nsIProtocolHandler ** hdlrResult
attribute boolean manageOfflineStatus
 While this is set, IOService will monitor an nsINetworkLinkService (if available) and set its offline status to "true" whenever isLinkUp is false.
attribute boolean offline
 Returns true if networking is in "offline" mode.

Static Public Attributes

static nsIMemorygBufferCache = nsnull

Private Member Functions

 nsIOService () NS_HIDDEN
 ~nsIOService () NS_HIDDEN
 NS_HIDDEN_ (nsresult) TrackNetworkLinkStatusForOffline()
 NS_HIDDEN_ (nsresult) GetCachedProtocolHandler(const char *scheme
 NS_HIDDEN_ (nsresult) CacheProtocolHandler(const char *scheme
 NS_HIDDEN_ (void) PrefsChanged(nsIPrefBranch *prefs
 NS_HIDDEN_ (void) GetPrefBranch(nsIPrefBranch2 **)
 NS_HIDDEN_ (void) ParsePortList(nsIPrefBranch *prefBranch

Private Attributes

nsIProtocolHandler ** hdlrResult
nsIProtocolHandler PRUint32 start = 0
nsIProtocolHandler PRUint32
PRUint32 
end = 0)
nsIProtocolHandlerhdlr
const char * pref = nsnull)
const char PRBool remove
PRPackedBool mOffline
PRPackedBool mOfflineForProfileChange
PRPackedBool mManageOfflineStatus
nsCOMPtr
< nsPISocketTransportService
mSocketTransportService
nsCOMPtr< nsPIDNSServicemDNSService
nsCOMPtr< nsIProtocolProxyServicemProxyService
nsCOMPtr< nsIEventQueueServicemEventQueueService
nsCOMPtr< nsINetworkLinkServicemNetworkLinkService
nsWeakPtr mWeakHandler [NS_N(gScheme)]
nsCategoryCache
< nsIChannelEventSink
mChannelEventSinks
nsCategoryCache
< nsIContentSniffer_MOZILLA_1_8_BRANCH
mContentSniffers
nsVoidArray mRestrictedPortList

Detailed Description

Definition at line 78 of file nsIOService.h.


Constructor & Destructor Documentation

nsIOService::nsIOService ( ) [private]

Definition at line 159 of file nsIOService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 257 of file nsIOService.cpp.


Member Function Documentation

boolean nsIIOService::allowPort ( in long  aPort,
in string  aScheme 
) [inherited]

Checks if a port number is banned.

This involves consulting a list of unsafe ports, corresponding to network services that may be easily exploitable. If the given port is considered unsafe, then the protocol handler (corresponding to aScheme) will be asked whether it wishes to override the IO service's decision to block the port. This gives the protocol handler ultimate control over its own security policy while ensuring reasonable, default protection.

See also:
nsIProtocolHandler::allowPort
ACString nsIIOService::extractScheme ( in AUTF8String  urlString) [inherited]

Utility to extract the scheme from a URL string, consistently and according to spec (see RFC 2396).

NOTE: Most URL parsing is done via nsIURI, and in fact the scheme can also be extracted from a URL string via nsIURI. This method is provided purely as an optimization.

Parameters:
aSpecthe URL string to parse
Returns:
URL scheme
Exceptions:
NS_ERROR_MALFORMED_URIif URL string is not of the right form.

Definition at line 107 of file nsIOService.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 263 of file nsIOService.cpp.

                         {
    if (!gIOService) {
        gIOService = new nsIOService();
        if (!gIOService)
            return nsnull;
        NS_ADDREF(gIOService);

        nsresult rv = gIOService->Init();
        if (NS_FAILED(rv)) {
            NS_RELEASE(gIOService);
            return nsnull;
        }
        return gIOService;
    }
    NS_ADDREF(gIOService);
    return gIOService;
}

Here is the call graph for this function:

unsigned long nsIIOService::getProtocolFlags ( in string  aScheme) [inherited]

Returns the protocol flags for a given scheme.

Parameters:
aSchemethe URI scheme
Returns:
value of corresponding nsIProtocolHandler::protocolFlags

Returns a protocol handler for a given URI scheme.

Parameters:
aSchemethe URI scheme
Returns:
reference to corresponding nsIProtocolHandler
nsIChannel nsIIOService::newChannel ( in AUTF8String  aSpec,
in string  aOriginCharset,
in nsIURI  aBaseURI 
) [inherited]

Equivalent to newChannelFromURI(newURI(...))

Creates a channel for a given URI.

Parameters:
aURInsIURI from which to make a channel
Returns:
reference to the new nsIChannel object
nsIURI nsIIOService::newFileURI ( in nsIFile  aFile) [inherited]

This method constructs a new URI from a nsIFile.

Parameters:
aFilespecifies the file path
Returns:
reference to a new nsIURI object
nsIURI nsIIOService::newURI ( in AUTF8String  aSpec,
in string  aOriginCharset,
in nsIURI  aBaseURI 
) [inherited]

This method constructs a new URI by determining the scheme of the URI spec, and then delegating the construction of the URI to the protocol handler for that scheme.

QueryInterface can be used on the resulting URI object to obtain a more specific type of URI.

See also:
nsIProtocolHandler::newURI
nsIOService::NS_HIDDEN_ ( nsresult  ) const [private]
nsIOService::NS_HIDDEN_ ( nsresult  ) const [private]
nsIOService::NS_HIDDEN_ ( void  ) [private]
nsIOService::NS_HIDDEN_ ( void  ) [private]
nsIOService::NS_HIDDEN_ ( void  ) [private]
void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
nsresult nsIOService::OnChannelRedirect ( nsIChannel oldChan,
nsIChannel newChan,
PRUint32  flags 
)

Here is the caller graph for this function:

AUTF8String nsINetUtil::parseContentType ( in AUTF8String  aTypeHeader,
out AUTF8String  aCharset,
out boolean  aHadCharset 
) [inherited]

Parse a content-type header and return the content type and charset (if any).

Parameters:
aTypeHeaderthe header string to parse
[out]aCharsetthe charset parameter specified in the header, if any.
[out]aHadCharsetwhether a charset was explicitly specified.
Returns:
the MIME type specified in the header, in lower-case.

Member Data Documentation

Definition at line 96 of file nsIOService.h.

Definition at line 123 of file nsIOService.h.

Definition at line 154 of file nsIOService.h.

Definition at line 125 of file nsIOService.h.

Definition at line 96 of file nsIOService.h.

Definition at line 121 of file nsIOService.h.

While this is set, IOService will monitor an nsINetworkLinkService (if available) and set its offline status to "true" whenever isLinkUp is false.

Applications that want to control changes to the IOService's offline status should set this to false, watch for network:link-status-changed broadcasts, and change nsIIOService::offline as they see fit. Note that this means during application startup, IOService may be offline if there is no link, until application code runs and can turn off this management.

Definition at line 61 of file nsIIOService2.idl.

Definition at line 146 of file nsIOService.h.

Definition at line 147 of file nsIOService.h.

Definition at line 137 of file nsIOService.h.

Definition at line 139 of file nsIOService.h.

Definition at line 135 of file nsIOService.h.

Definition at line 140 of file nsIOService.h.

Definition at line 133 of file nsIOService.h.

Definition at line 134 of file nsIOService.h.

Definition at line 138 of file nsIOService.h.

Definition at line 149 of file nsIOService.h.

Definition at line 136 of file nsIOService.h.

Definition at line 143 of file nsIOService.h.

Returns true if networking is in "offline" mode.

When in offline mode, attempts to access the network will fail (although this is not necessarily corrolated with whether there is actually a network available -- that's hard to detect without causing the dialer to come up).

Changing this fires observer notifications ... see below.

Definition at line 119 of file nsIIOService.idl.

const char * nsIOService::pref = nsnull) [private]

Definition at line 128 of file nsIOService.h.

Definition at line 130 of file nsIOService.h.

Definition at line 96 of file nsIOService.h.

Definition at line 122 of file nsIOService.h.


The documentation for this class was generated from the following files: