Struct xpcom::interfaces::nsIIOService
[−]
[src]
#[repr(C)]pub struct nsIIOService { /* fields omitted */ }
interface nsIIOService : nsISupports
/**
* nsIIOService provides a set of network utility functions. This interface
* duplicates many of the nsIProtocolHandler methods in a protocol handler
* independent way (e.g., NewURI inspects the scheme in order to delegate
* creation of the new URI to the appropriate protocol handler). nsIIOService
* also provides a set of URL parsing utility functions. These are provided
* as a convenience to the programmer and in some cases to improve performance
* by eliminating intermediate data structures and interfaces.
*/
Methods
impl nsIIOService
[src]
pub fn coerce<T: nsIIOServiceCoerce>(&self) -> &T
[src]
Cast this nsIIOService
to one of its base interfaces.
impl nsIIOService
[src]
pub unsafe fn GetProtocolHandler(
&self,
aScheme: *const c_char,
_retval: *mut *const nsIProtocolHandler
) -> nsresult
[src]
&self,
aScheme: *const c_char,
_retval: *mut *const nsIProtocolHandler
) -> nsresult
/**
* Returns a protocol handler for a given URI scheme.
*
* @param aScheme the URI scheme
* @return reference to corresponding nsIProtocolHandler
*/
nsIProtocolHandler getProtocolHandler (in string aScheme);
pub unsafe fn GetProtocolFlags(
&self,
aScheme: *const c_char,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aScheme: *const c_char,
_retval: *mut uint32_t
) -> nsresult
/**
* Returns the protocol flags for a given scheme.
*
* @param aScheme the URI scheme
* @return value of corresponding nsIProtocolHandler::protocolFlags
*/
unsigned long getProtocolFlags (in string aScheme);
pub unsafe fn NewURI(
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
_retval: *mut *const nsIURI
) -> nsresult
[src]
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
_retval: *mut *const nsIURI
) -> nsresult
/**
* 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 nsIProtocolHandler::newURI
*/
nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI);
pub unsafe fn NewFileURI(
&self,
aFile: *const nsIFile,
_retval: *mut *const nsIURI
) -> nsresult
[src]
&self,
aFile: *const nsIFile,
_retval: *mut *const nsIURI
) -> nsresult
/**
* This method constructs a new URI from a nsIFile.
*
* @param aFile specifies the file path
* @return reference to a new nsIURI object
*
* Note: in the future, for perf reasons we should allow
* callers to specify whether this is a file or directory by
* splitting this into newDirURI() and newActualFileURI().
*/
nsIURI newFileURI (in nsIFile aFile);
pub unsafe fn NewChannelFromURI2(
&self,
aURI: *const nsIURI,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* Creates a channel for a given URI.
*
* @param aURI
* nsIURI from which to make a channel
* @param aLoadingNode
* @param aLoadingPrincipal
* @param aTriggeringPrincipal
* @param aSecurityFlags
* @param aContentPolicyType
* These will be used as values for the nsILoadInfo object on the
* created channel. For details, see nsILoadInfo in nsILoadInfo.idl
* @return reference to the new nsIChannel object
*
* Please note, if you provide both a loadingNode and a loadingPrincipal,
* then loadingPrincipal must be equal to loadingNode->NodePrincipal().
* But less error prone is to just supply a loadingNode.
*
* Keep in mind that URIs coming from a webpage should *never* use the
* systemPrincipal as the loadingPrincipal.
*/
nsIChannel newChannelFromURI2 (in nsIURI aURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);
pub unsafe fn NewChannelFromURIWithLoadInfo(
&self,
aURI: *const nsIURI,
aLoadInfo: *const nsILoadInfo,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aLoadInfo: *const nsILoadInfo,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* Equivalent to newChannelFromURI2(aURI, aLoadingNode, ...)
*/
nsIChannel newChannelFromURIWithLoadInfo (in nsIURI aURI, in nsILoadInfo aLoadInfo);
pub unsafe fn NewChannel2(
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* Equivalent to newChannelFromURI2(newURI(...))
*/
nsIChannel newChannel2 (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);
pub unsafe fn NewChannelFromURI(
&self,
aURI: *const nsIURI,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* ***** DEPRECATED *****
* Please use NewChannelFromURI2()
*
* Creates a channel for a given URI.
*
* @param aURI nsIURI from which to make a channel
* @return reference to the new nsIChannel object
*/
nsIChannel newChannelFromURI (in nsIURI aURI);
pub unsafe fn NewChannel(
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aSpec: &nsACString,
aOriginCharset: *const c_char,
aBaseURI: *const nsIURI,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* ***** DEPRECATED *****
* Please use newChannel2().
*
* Equivalent to newChannelFromURI(newURI(...))
*/
nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI);
pub unsafe fn GetOffline(&self, aOffline: *mut bool) -> nsresult
[src]
/**
* Returns true if networking is in "offline" mode. When in offline mode,
* attempts to access the network will fail (although this does not
* necessarily correlate 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.
*/
attribute boolean offline;
pub unsafe fn SetOffline(&self, aOffline: bool) -> nsresult
[src]
/**
* Returns true if networking is in "offline" mode. When in offline mode,
* attempts to access the network will fail (although this does not
* necessarily correlate 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.
*/
attribute boolean offline;
pub unsafe fn GetConnectivity(&self, aConnectivity: *mut bool) -> nsresult
[src]
/**
* Returns false if there are no interfaces for a network request
*/
readonly attribute boolean connectivity;
pub unsafe fn AllowPort(
&self,
aPort: int32_t,
aScheme: *const c_char,
_retval: *mut bool
) -> nsresult
[src]
&self,
aPort: int32_t,
aScheme: *const c_char,
_retval: *mut bool
) -> nsresult
/**
* 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 nsIProtocolHandler::allowPort
*/
boolean allowPort (in long aPort, in string aScheme);
pub unsafe fn ExtractScheme(
&self,
urlString: &nsACString,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
urlString: &nsACString,
_retval: &mut nsACString
) -> nsresult
/**
* 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.
*
* @param aSpec the URL string to parse
* @return URL scheme
*
* @throws NS_ERROR_MALFORMED_URI if URL string is not of the right form.
*/
ACString extractScheme (in AUTF8String urlString);
pub unsafe fn HostnameIsLocalIPAddress(
&self,
aURI: *const nsIURI,
_retval: *mut bool
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
_retval: *mut bool
) -> nsresult
/**
* Checks if a URI host is a local IPv4 or IPv6 address literal.
*
* @param nsIURI the URI that contains the hostname to check
* @return true if the URI hostname is a local IP address
*/
boolean hostnameIsLocalIPAddress (in nsIURI aURI);
pub unsafe fn GetManageOfflineStatus(
&self,
aManageOfflineStatus: *mut bool
) -> nsresult
[src]
&self,
aManageOfflineStatus: *mut bool
) -> nsresult
/**
* 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.
*/
attribute boolean manageOfflineStatus;
pub unsafe fn SetManageOfflineStatus(
&self,
aManageOfflineStatus: bool
) -> nsresult
[src]
&self,
aManageOfflineStatus: bool
) -> nsresult
/**
* 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.
*/
attribute boolean manageOfflineStatus;
pub unsafe fn NewChannelFromURIWithProxyFlags2(
&self,
aURI: *const nsIURI,
aProxyURI: *const nsIURI,
aProxyFlags: uint32_t,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aProxyURI: *const nsIURI,
aProxyFlags: uint32_t,
aLoadingNode: *const nsIDOMNode,
aLoadingPrincipal: *const nsIPrincipal,
aTriggeringPrincipal: *const nsIPrincipal,
aSecurityFlags: uint32_t,
aContentPolicyType: uint32_t,
_retval: *mut *const nsIChannel
) -> nsresult
/**
* Creates a channel for a given URI.
*
* @param aURI
* nsIURI from which to make a channel
* @param aProxyURI
* nsIURI to use for proxy resolution. Can be null in which
* case aURI is used
* @param aProxyFlags flags from nsIProtocolProxyService to use
* when resolving proxies for this new channel
* @param aLoadingNode
* @param aLoadingPrincipal
* @param aTriggeringPrincipal
* @param aSecurityFlags
* @param aContentPolicyType
* These will be used as values for the nsILoadInfo object on the
* created channel. For details, see nsILoadInfo in nsILoadInfo.idl
* @return reference to the new nsIChannel object
*
* Please note, if you provide both a loadingNode and a loadingPrincipal,
* then loadingPrincipal must be equal to loadingNode->NodePrincipal().
* But less error prone is to just supply a loadingNode.
*/
nsIChannel newChannelFromURIWithProxyFlags2 (in nsIURI aURI, in nsIURI aProxyURI, in unsigned long aProxyFlags, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIIOService
[src]
const IID: nsIID
IID: nsIID = nsID(1116135002, 45802, 17519, [143, 112, 226, 164, 97, 244, 38, 148])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIIOService
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIIOService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.