B2G/gecko/toolkit/devtools/webconsole/dbg-webconsole-actors.js
/**
   * Handler for the "stopListeners" request.
   *
   * @param object aRequest
   *        The JSON request object received from the Web Console client.
   * @return object
   *         The response packet to send to the client: holds the
   *         stoppedListeners array.
   */
Handler for the "stopListeners" request.
@param object aRequest
The JSON request object received from the Web Console client.
@return object
The response packet to send to the client: holds the
stoppedListeners array.
Handler for the " stopListeners " request . @param object aRequest The JSON request object received from the Web Console client . @return object The response packet to send to the client : holds the stoppedListeners array .
function WCA_onStopListeners(aRequest)
  {
    let stoppedListeners = [];
    let toDetach = aRequest.listeners ||
                   ["PageError", "ConsoleAPI", "NetworkActivity",
                    "FileActivity", "LocationChange"];
    while (toDetach.length > 0) {
      let listener = toDetach.shift();
      switch (listener) {
        case "PageError":
          if (this.pageErrorListener) {
            this.pageErrorListener.destroy();
            this.pageErrorListener = null;
          }
          stoppedListeners.push(listener);
          break;
        case "ConsoleAPI":
          if (this.consoleAPIListener) {
            this.consoleAPIListener.destroy();
            this.consoleAPIListener = null;
          }
          stoppedListeners.push(listener);
          break;
        case "NetworkActivity":
          if (this.networkMonitor) {
            this.networkMonitor.destroy();
            this.networkMonitor = null;
          }
          stoppedListeners.push(listener);
          break;
        case "FileActivity":
          if (this.consoleProgressListener) {
            this.consoleProgressListener.stopMonitor(this.consoleProgressListener.
                                                     MONITOR_FILE_ACTIVITY);
          }
          stoppedListeners.push(listener);
          break;
        case "LocationChange":
          if (this.consoleProgressListener) {
            this.consoleProgressListener.stopMonitor(this.consoleProgressListener.
                                                     MONITOR_LOCATION_CHANGE);
          }
          stoppedListeners.push(listener);
          break;
      }
    }
    return { stoppedListeners: stoppedListeners };
  }
function WCA_onStopListeners ( aRequest ) { let stoppedListeners = [ ] ; let toDetach = aRequest . listeners || [ "PageError" , "ConsoleAPI" , "NetworkActivity" , "FileActivity" , "LocationChange" ] ; while ( toDetach . length > 0 ) { let listener = toDetach . shift ( ) ; switch ( listener ) { case "PageError" : if ( this . pageErrorListener ) { this . pageErrorListener . destroy ( ) ; this . pageErrorListener = null ; } stoppedListeners . push ( listener ) ; break ; case "ConsoleAPI" : if ( this . consoleAPIListener ) { this . consoleAPIListener . destroy ( ) ; this . consoleAPIListener = null ; } stoppedListeners . push ( listener ) ; break ; case "NetworkActivity" : if ( this . networkMonitor ) { this . networkMonitor . destroy ( ) ; this . networkMonitor = null ; } stoppedListeners . push ( listener ) ; break ; case "FileActivity" : if ( this . consoleProgressListener ) { this . consoleProgressListener . stopMonitor ( this . consoleProgressListener . MONITOR_FILE_ACTIVITY ) ; } stoppedListeners . push ( listener ) ; break ; case "LocationChange" : if ( this . consoleProgressListener ) { this . consoleProgressListener . stopMonitor ( this . consoleProgressListener . MONITOR_LOCATION_CHANGE ) ; } stoppedListeners . push ( listener ) ; break ; } } return { stoppedListeners : stoppedListeners } ; }
Handler for the "stopListeners" request.
Handler for the " stopListeners " request .
// If no specific listeners are requested to be detached, we stop all // listeners.