nsISupports
Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)void observeActivity(in nsISupports aHttpChannel, in PRUint32 aActivityType, in PRUint32 aActivitySubtype, in PRTime aTimestamp, in PRUint64 aExtraSizeData, in ACString aExtraStringData); |
Attribute | Type | Description |
isActive | boolean |
Note: This attribute is present only for compatibility and should not be used. |
Constant | Value | Description |
ACTIVITY_TYPE_SOCKET_TRANSPORT | 0x0001 | Socket transport activity has occurred. |
ACTIVITY_TYPE_HTTP_TRANSACTION | 0x0002 | HTTP transport activity has occurred. |
Constant | Value | Description |
ACTIVITY_SUBTYPE_REQUEST_HEADER | 0x5001 | The HTTP request is about to be queued for sending. Observers can look at request headers in aExtraStringData |
ACTIVITY_SUBTYPE_REQUEST_BODY_SENT | 0x5002 | The HTTP request's body has been sent. |
ACTIVITY_SUBTYPE_RESPONSE_START | 0x5003 | The HTTP response has started to arrive. |
ACTIVITY_SUBTYPE_RESPONSE_HEADER | 0x5004 | The HTTP response header has arrived. |
ACTIVITY_SUBTYPE_RESPONSE_COMPLETE | 0x5005 | The complete HTTP response has been received. |
ACTIVITY_SUBTYPE_TRANSACTION_CLOSE | 0x5006 | The HTTP transaction has been closed. |
Called when activity occurs on the HTTP transport. You should implement this method to perform whatever tasks you wish to perform when HTTP activity occurs.
void observeActivity( in nsISupports aHttpChannel, in PRUint32 aActivityType, in PRUint32 aActivitySubtype, in PRTime aTimestamp, in PRUint64 aExtraSizeData, in ACString aExtraStringData );
aHttpChannel
nsIHttpChannel
on which the activity occurred.aActivityType
aActivitySubtype
ACTIVITY_TYPE_SOCKET_TRANSPORT
, this value will be one of the STATUS_*
constants defined by nsISocketTransport
. If the activity type is ACTIVITY_TYPE_HTTP_TRANSACTION
, this will be one of the constants specified in Activity subtype constants above.aTimestamp
aExtraSizeData
aExtraStringData
Depending on the values of the aActivityType
and aActivitySubtype
fields, the aExtraSizeData
and aExtraStringData
parameters take on different meanings.
When the activity type is ACTIVITY_TYPE_SOCKET_TRANSPORT
and the subtype is STATUS_SENDING_TO
, the aExtraSizeData
parameter contains the number of bytes sent. Because a single HTTP transaction may consist of multiple chunks of data transmitted through separate socket writes, each socket activity notification will only reflect the number of bytes transmitted in that chunk.
For activity notifications of type ACTIVITY_TYPE_HTTP_TRANSACTION
, there are three activities that include extra data:
ACTIVITY_SUBTYPE_REQUEST_HEADER
aExtraStringData
contains the text of the header.ACTIVITY_SUBTYPE_RESPONSE_HEADER
aExtraStringData
contains the text of the response header.ACTIVITY_SUBTYPE_RESPONSE_COMPLETE
aExtraSizeData
contains the total number of bytes received.