B2G/gecko/toolkit/components/captivedetect/captivedetect.js
/*
     * Check if login activity is finished according to HTTP burst.
     */
Check if login activity is finished according to HTTP burst.
Check if login activity is finished according to HTTP burst .
function notify() {
      switch(state) {
        case LOGIN_OBSERVER_STATE_BURST:
          state = LOGIN_OBSERVER_STATE_VERIFY_NEEDED;
        case LOGIN_OBSERVER_STATE_IDLE:
          timer.initWithCallback(this,
                                 captivePortalDetector._pollingTime,
                                 timer.TYPE_ONE_SHOT);
          break;
        case LOGIN_OBSERVER_STATE_VERIFY_NEEDED:
          state = LOGIN_OBSERVER_STATE_VERIFYING;
          checkPageContent();
          break;
        default:
          break;
      }
    }
function notify ( ) { switch ( state ) { case LOGIN_OBSERVER_STATE_BURST : state = LOGIN_OBSERVER_STATE_VERIFY_NEEDED ; case LOGIN_OBSERVER_STATE_IDLE : timer . initWithCallback ( this , captivePortalDetector . _pollingTime , timer . TYPE_ONE_SHOT ) ; break ; case LOGIN_OBSERVER_STATE_VERIFY_NEEDED : state = LOGIN_OBSERVER_STATE_VERIFYING ; checkPageContent ( ) ; break ; default : break ; } }
Check if login activity is finished according to HTTP burst.
Check if login activity is finished according to HTTP burst .
// Wait while network stays idle for a short period // Fall though to start polling timer // Polling the canonical website since network stays idle for a while