B2G/gecko/toolkit/devtools/webconsole/dbg-webconsole-actors.js
/**
   * Handler for the "getCachedMessages" request. This method sends the cached
   * error messages and the window.console API calls to the client.
   *
   * @param object aRequest
   *        The JSON request object received from the Web Console client.
   * @return object
   *         The response packet to send to the client: it holds the cached
   *         messages array.
   */
Handler for the "getCachedMessages" request. This method sends the cached
error messages and the window.console API calls to the client.

@param object aRequest
The JSON request object received from the Web Console client.
@return object
The response packet to send to the client: it holds the cached
messages array.
Handler for the " getCachedMessages " request . This method sends the cached error messages and the window . console API calls to the client . @param object aRequest The JSON request object received from the Web Console client . @return object The response packet to send to the client : it holds the cached messages array .
function WCA_onGetCachedMessages(aRequest)
  {
    let types = aRequest.messageTypes;
    if (!types) {
      return {
        error: "missingParameter",
        message: "The messageTypes parameter is missing.",
      };
    }
    let messages = [];
    while (types.length > 0) {
      let type = types.shift();
      switch (type) {
        case "ConsoleAPI":
          if (this.consoleAPIListener) {
            let cache = this.consoleAPIListener.getCachedMessages();
            cache.forEach(function(aMessage) {
              let message = this.prepareConsoleMessageForRemote(aMessage);
              message._type = type;
              messages.push(message);
            }, this);
          }
          break;
        case "PageError":
          if (this.pageErrorListener) {
            let cache = this.pageErrorListener.getCachedMessages();
            cache.forEach(function(aMessage) {
              let message = this.preparePageErrorForRemote(aMessage);
              message._type = type;
              messages.push(message);
            }, this);
          }
          break;
      }
    }
    messages.sort(function(a, b) { return a.timeStamp - b.timeStamp; });
    return {
      from: this.actorID,
      messages: messages,
    };
  }
function WCA_onGetCachedMessages ( aRequest ) { let types = aRequest . messageTypes ; if ( ! types ) { return { error : "missingParameter" , message : "The messageTypes parameter is missing." , } ; } let messages = [ ] ; while ( types . length > 0 ) { let type = types . shift ( ) ; switch ( type ) { case "ConsoleAPI" : if ( this . consoleAPIListener ) { let cache = this . consoleAPIListener . getCachedMessages ( ) ; cache . forEach ( function ( aMessage ) { let message = this . prepareConsoleMessageForRemote ( aMessage ) ; message . _type = type ; messages . push ( message ) ; } , this ) ; } break ; case "PageError" : if ( this . pageErrorListener ) { let cache = this . pageErrorListener . getCachedMessages ( ) ; cache . forEach ( function ( aMessage ) { let message = this . preparePageErrorForRemote ( aMessage ) ; message . _type = type ; messages . push ( message ) ; } , this ) ; } break ; } } messages . sort ( function ( a , b ) { return a . timeStamp - b . timeStamp ; } ) ; return { from : this . actorID , messages : messages , } ; }
Handler for the "getCachedMessages" request.
Handler for the " getCachedMessages " request .