B2G/gecko/services/common/async.js
/**
   * Check if the app is still ready (not quitting).
   */
Check if the app is still ready (not quitting).
Check if the app is still ready ( not quitting ) .
function checkAppReady() {
    Services.obs.addObserver(function onQuitApplication() {
      Services.obs.removeObserver(onQuitApplication, "quit-application");
      Async.checkAppReady = function() {
        throw Components.Exception("App. Quitting", Cr.NS_ERROR_ABORT);
      };
    }, "quit-application", false);
    return (Async.checkAppReady = function() { return true; })();
  }
function checkAppReady ( ) { Services . obs . addObserver ( function onQuitApplication ( ) { Services . obs . removeObserver ( onQuitApplication , "quit-application" ) ; Async . checkAppReady = function ( ) { throw Components . Exception ( "App. Quitting" , Cr . NS_ERROR_ABORT ) ; } ; } , "quit-application" , false ) ; return ( Async . checkAppReady = function ( ) { return true ; } ) ( ) ; }
Check if the app is still ready (not quitting).
Check if the app is still ready ( not quitting ) .
// Watch for app-quit notification to stop any sync calls // In the common case, checkAppReady just returns true