B2G/gecko/toolkit/devtools/webconsole/dbg-webconsole-actors.js
/**
   * Handler for the "startListeners" request.
   *
   * @param object aRequest
   *        The JSON request object received from the Web Console client.
   * @return object
   *         The response object which holds the startedListeners array.
   */
Handler for the "startListeners" request.
@param object aRequest
The JSON request object received from the Web Console client.
@return object
The response object which holds the startedListeners array.
Handler for the " startListeners " request . @param object aRequest The JSON request object received from the Web Console client . @return object The response object which holds the startedListeners array .
function WCA_onStartListeners(aRequest)
  {
    let startedListeners = [];
    let window = !this._isGlobalActor ? this.window : null;
    while (aRequest.listeners.length > 0) {
      let listener = aRequest.listeners.shift();
      switch (listener) {
        case "PageError":
          if (!this.pageErrorListener) {
            this.pageErrorListener =
              new PageErrorListener(window, this);
            this.pageErrorListener.init();
          }
          startedListeners.push(listener);
          break;
        case "ConsoleAPI":
          if (!this.consoleAPIListener) {
            this.consoleAPIListener =
              new ConsoleAPIListener(window, this);
            this.consoleAPIListener.init();
          }
          startedListeners.push(listener);
          break;
        case "NetworkActivity":
          if (!this.networkMonitor) {
            this.networkMonitor =
              new NetworkMonitor(window, this);
            this.networkMonitor.init();
          }
          startedListeners.push(listener);
          break;
        case "FileActivity":
          if (!this.consoleProgressListener) {
            this.consoleProgressListener =
              new ConsoleProgressListener(this.window, this);
          }
          this.consoleProgressListener.startMonitor(this.consoleProgressListener.
                                                    MONITOR_FILE_ACTIVITY);
          startedListeners.push(listener);
          break;
        case "LocationChange":
          if (!this.consoleProgressListener) {
            this.consoleProgressListener =
              new ConsoleProgressListener(this.window, this);
          }
          this.consoleProgressListener.startMonitor(this.consoleProgressListener.
                                                    MONITOR_LOCATION_CHANGE);
          startedListeners.push(listener);
          break;
      }
    }
    return {
      startedListeners: startedListeners,
      nativeConsoleAPI: this.hasNativeConsoleAPI(),
    };
  }
function WCA_onStartListeners ( aRequest ) { let startedListeners = [ ] ; let window = ! this . _isGlobalActor ? this . window : null ; while ( aRequest . listeners . length > 0 ) { let listener = aRequest . listeners . shift ( ) ; switch ( listener ) { case "PageError" : if ( ! this . pageErrorListener ) { this . pageErrorListener = new PageErrorListener ( window , this ) ; this . pageErrorListener . init ( ) ; } startedListeners . push ( listener ) ; break ; case "ConsoleAPI" : if ( ! this . consoleAPIListener ) { this . consoleAPIListener = new ConsoleAPIListener ( window , this ) ; this . consoleAPIListener . init ( ) ; } startedListeners . push ( listener ) ; break ; case "NetworkActivity" : if ( ! this . networkMonitor ) { this . networkMonitor = new NetworkMonitor ( window , this ) ; this . networkMonitor . init ( ) ; } startedListeners . push ( listener ) ; break ; case "FileActivity" : if ( ! this . consoleProgressListener ) { this . consoleProgressListener = new ConsoleProgressListener ( this . window , this ) ; } this . consoleProgressListener . startMonitor ( this . consoleProgressListener . MONITOR_FILE_ACTIVITY ) ; startedListeners . push ( listener ) ; break ; case "LocationChange" : if ( ! this . consoleProgressListener ) { this . consoleProgressListener = new ConsoleProgressListener ( this . window , this ) ; } this . consoleProgressListener . startMonitor ( this . consoleProgressListener . MONITOR_LOCATION_CHANGE ) ; startedListeners . push ( listener ) ; break ; } } return { startedListeners : startedListeners , nativeConsoleAPI : this . hasNativeConsoleAPI ( ) , } ; }
Handler for the "startListeners" request.
Handler for the " startListeners " request .