B2G/gecko/toolkit/components/places/tests/browser/browser_visituri.js
/**
 * One-time observer callback.
 */
One-time observer callback.
One - time observer callback .
function waitForObserve(name, callback)
{
  var observerService = Cc["@mozilla.org/observer-service;1"]
                        .getService(Ci.nsIObserverService);
  var observer = {
    QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
    observe: function(subject, topic, data) {
      observerService.removeObserver(observer, name);
      observer = null;
      callback(subject, topic, data);
    }
  };
  observerService.addObserver(observer, name, false);
}
function waitForObserve ( name , callback ) { var observerService = Cc [ "@mozilla.org/observer-service;1" ] . getService ( Ci . nsIObserverService ) ; var observer = { QueryInterface : XPCOMUtils . generateQI ( [ Ci . nsIObserver ] ) , observe : function ( subject , topic , data ) { observerService . removeObserver ( observer , name ) ; observer = null ; callback ( subject , topic , data ) ; } } ; observerService . addObserver ( observer , name , false ) ; }
One-time observer callback.
One - time observer callback .