| || || |
Note: This attribute is present only for compatibility and should not be used.
Activity type constants
| || ||Socket transport activity has occurred.|
| || ||HTTP transport activity has occurred.|
Activity subtype constants
| || ||The HTTP request is about to be queued for sending. Observers can look at request headers in |
| || ||The HTTP request's body has been sent.|
| || ||The HTTP response has started to arrive.|
| || ||The HTTP response header has arrived.|
| || ||The complete HTTP response has been received.|
| || ||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 );
nsIHttpChannelon which the activity occurred.
- The type of activity that occurred; this will be one of the values specified in Activity type constants.
- The subtype that further narrows the type of activity that occurred. If the activity type is
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.
- The time at which the activity occurred, specified as microseconds elapsed since the epoch of midnight on January 1, 1970.
- Any additional size data available with this activity. See Interpreting activity data below.
- Any additional string data available with this activity. See Interpreting activity data below.
Interpreting activity data
Depending on the values of the
aActivitySubtype fields, the
aExtraStringData parameters take on different meanings.
Socket transport activity
When the activity type is
ACTIVITY_TYPE_SOCKET_TRANSPORT and the subtype is
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.
HTTP transaction activity
For activity notifications of type
ACTIVITY_TYPE_HTTP_TRANSACTION, there are three activities that include extra data:
aExtraStringDatacontains the text of the header.
aExtraStringDatacontains the text of the response header.
aExtraSizeDatacontains the total number of bytes received.