B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Handle network event updates coming from the server.
   *
   * @param string aActorId
   *        The network event actor ID.
   * @param string aType
   *        Update type.
   * @param object aPacket
   *        Update details.
   */
Handle network event updates coming from the server.
@param string aActorId
The network event actor ID.
@param string aType
Update type.
@param object aPacket
Update details.
Handle network event updates coming from the server . @param string aActorId The network event actor ID . @param string aType Update type . @param object aPacket Update details .
function WCF_handleNetworkEventUpdate(aActorId, aType, aPacket)
  {
    let networkInfo = this._networkRequests[aActorId];
    if (!networkInfo) {
      return;
    }
    networkInfo.updates.push(aType);
    switch (aType) {
      case "requestHeaders":
        networkInfo.request.headersSize = aPacket.headersSize;
        break;
      case "requestPostData":
        networkInfo.discardRequestBody = aPacket.discardRequestBody;
        networkInfo.request.bodySize = aPacket.dataSize;
        break;
      case "responseStart":
        networkInfo.response.httpVersion = aPacket.response.httpVersion;
        networkInfo.response.status = aPacket.response.status;
        networkInfo.response.statusText = aPacket.response.statusText;
        networkInfo.response.headersSize = aPacket.response.headersSize;
        networkInfo.discardResponseBody = aPacket.response.discardResponseBody;
        break;
      case "responseContent":
        networkInfo.response.content = {
          mimeType: aPacket.mimeType,
        };
        networkInfo.response.bodySize = aPacket.contentSize;
        networkInfo.discardResponseBody = aPacket.discardResponseBody;
        break;
      case "eventTimings":
        networkInfo.totalTime = aPacket.totalTime;
        break;
    }
    if (networkInfo.node) {
      this._updateNetMessage(aActorId);
    }
    if (this.owner.lastFinishedRequestCallback &&
        networkInfo.updates.indexOf("responseContent") > -1 &&
        networkInfo.updates.indexOf("eventTimings") > -1) {
      this.owner.lastFinishedRequestCallback(networkInfo, this);
    }
  }
function WCF_handleNetworkEventUpdate ( aActorId , aType , aPacket ) { let networkInfo = this . _networkRequests [ aActorId ] ; if ( ! networkInfo ) { return ; } networkInfo . updates . push ( aType ) ; switch ( aType ) { case "requestHeaders" : networkInfo . request . headersSize = aPacket . headersSize ; break ; case "requestPostData" : networkInfo . discardRequestBody = aPacket . discardRequestBody ; networkInfo . request . bodySize = aPacket . dataSize ; break ; case "responseStart" : networkInfo . response . httpVersion = aPacket . response . httpVersion ; networkInfo . response . status = aPacket . response . status ; networkInfo . response . statusText = aPacket . response . statusText ; networkInfo . response . headersSize = aPacket . response . headersSize ; networkInfo . discardResponseBody = aPacket . response . discardResponseBody ; break ; case "responseContent" : networkInfo . response . content = { mimeType : aPacket . mimeType , } ; networkInfo . response . bodySize = aPacket . contentSize ; networkInfo . discardResponseBody = aPacket . discardResponseBody ; break ; case "eventTimings" : networkInfo . totalTime = aPacket . totalTime ; break ; } if ( networkInfo . node ) { this . _updateNetMessage ( aActorId ) ; } if ( this . owner . lastFinishedRequestCallback && networkInfo . updates . indexOf ( "responseContent" ) > - 1 && networkInfo . updates . indexOf ( "eventTimings" ) > - 1 ) { this . owner . lastFinishedRequestCallback ( networkInfo , this ) ; } }
Handle network event updates coming from the server.
Handle network event updates coming from the server .
// For unit tests we pass the HTTP activity object to the test callback, // once requests complete.