Public Member Functions | Public Attributes

nsIChannelEventSink Interface Reference

Implement this interface to receive control over various channel events. More...

import "nsIChannelEventSink.idl";

Inheritance diagram for nsIChannelEventSink:

List of all members.

Public Member Functions

void onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags)
 Called when a redirect occurs.

Public Attributes

const unsigned long REDIRECT_TEMPORARY = 1 << 0
 This is a temporary redirect.
const unsigned long REDIRECT_PERMANENT = 1 << 1
 This is a permanent redirect.
const unsigned long REDIRECT_INTERNAL = 1 << 2
 This is an internal redirect, i.e.

Detailed Description

Implement this interface to receive control over various channel events.

Channels will try to get this interface from a channel's notificationCallbacks or, if not available there, from the loadGroup's notificationCallbacks.

These methods are called before onStartRequest, and should be handled SYNCHRONOUSLY.


Member Function Documentation

void nsIChannelEventSink::onChannelRedirect ( in nsIChannel  oldChannel,
in nsIChannel  newChannel,
in unsigned long  flags 
)

Called when a redirect occurs.

This may happen due to an HTTP 3xx status code.

Parameters:
oldChannel The channel that's being redirected.
newChannel The new channel. This channel is not opened yet.
flags Flags indicating the type of redirect. A bitmask consisting of flags from above. One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be set.
Exceptions:
<any> Throwing an exception will cancel the load. No network request for the new channel will be made.

Member Data Documentation

const unsigned long nsIChannelEventSink::REDIRECT_INTERNAL = 1 << 2

This is an internal redirect, i.e.

it was not initiated by the remote server, but is specific to the channel implementation.

The new URI may be identical to the old one.

const unsigned long nsIChannelEventSink::REDIRECT_PERMANENT = 1 << 1

This is a permanent redirect.

New requests for this resource should use the URI of the new channel (This might be an HTTP 301 reponse). If this flag is not set, this is a temporary redirect.

The new URI may be identical to the old one.

const unsigned long nsIChannelEventSink::REDIRECT_TEMPORARY = 1 << 0

This is a temporary redirect.

New requests for this resource should continue to use the URI of the old channel.

The new URI may be identical to the old one.


The documentation for this interface was generated from the following file: