B2G/gecko/extensions/cookie/test/channel_utils.js
/**
 * A stream listener that calls a callback function with a specified
 * context and the received data when the channel is loaded.
 *
 * Signature of the closure:
 *   void closure(in nsIRequest request, in ACString data, in JSObject context);
 *
 * This listener makes sure that various parts of the channel API are
 * implemented correctly and that the channel's status is a success code
 * (you can pass CL_EXPECT_FAILURE or CL_EXPECT_LATE_FAILURE as flags
 * to allow a failure code)
 *
 * Note that it also requires a valid content length on the channel and
 * is thus not fully generic.
 */
A stream listener that calls a callback function with a specified
context and the received data when the channel is loaded.

Signature of the closure:
void closure(in nsIRequest request, in ACString data, in JSObject context).

This listener makes sure that various parts of the channel API are
implemented correctly and that the channel's status is a success code
(you can pass CL_EXPECT_FAILURE or CL_EXPECT_LATE_FAILURE as flags
to allow a failure code)

Note that it also requires a valid content length on the channel and
is thus not fully generic.
A stream listener that calls a callback function with a specified context and the received data when the channel is loaded . Signature of the closure : void closure ( in nsIRequest request in ACString data in JSObject context ) . This listener makes sure that various parts of the channel API are implemented correctly and that the channel ' s status is a success code ( you can pass CL_EXPECT_FAILURE or CL_EXPECT_LATE_FAILURE as flags to allow a failure code ) Note that it also requires a valid content length on the channel and is thus not fully generic .
function ChannelListener(closure, ctx, flags) {
  this._closure = closure;
  this._closurectx = ctx;
  this._flags = flags;
}
function ChannelListener ( closure , ctx , flags ) { this . _closure = closure ; this . _closurectx = ctx ; this . _flags = flags ; }
A stream listener that calls a callback function with a specified
 context and the received data when the channel is loaded.
A stream listener that calls a callback function with a specified context and the received data when the channel is loaded .