B2G/gecko/toolkit/mozapps/update/nsUpdateService.js
/**
   * When the async request begins
   * @param   request
   *          The nsIRequest object for the transfer
   * @param   context
   *          Additional data
   */
When the async request begins
@param   request
The nsIRequest object for the transfer
@param   context
Additional data
When the async request begins @param request The nsIRequest object for the transfer @param context Additional data
function Downloader_onStartRequest(request, context) {
    if (request instanceof Ci.nsIIncrementalDownload)
      LOG("Downloader:onStartRequest - original URI spec: " + request.URI.spec +
          ", final URI spec: " + request.finalURI.spec);
    this._patch.finalURL = request.finalURI.spec;
    var um = Cc["@mozilla.org/updates/update-manager;1"].
             getService(Ci.nsIUpdateManager);
    um.saveUpdates();
    var listeners = this._listeners.concat();
    var listenerCount = listeners.length;
    for (var i = 0; i < listenerCount; ++i)
      listeners[i].onStartRequest(request, context);
  }
function Downloader_onStartRequest ( request , context ) { if ( request instanceof Ci . nsIIncrementalDownload ) LOG ( "Downloader:onStartRequest - original URI spec: " + request . URI . spec + ", final URI spec: " + request . finalURI . spec ) ; this . _patch . finalURL = request . finalURI . spec ; var um = Cc [ "@mozilla.org/updates/update-manager;1" ] . getService ( Ci . nsIUpdateManager ) ; um . saveUpdates ( ) ; var listeners = this . _listeners . concat ( ) ; var listenerCount = listeners . length ; for ( var i = 0 ; i < listenerCount ; ++ i ) listeners [ i ] . onStartRequest ( request , context ) ; }
When the async request begins
 @param   request
          The nsIRequest object for the transfer
 @param   context
          Additional data
When the async request begins @param request The nsIRequest object for the transfer @param context Additional data
// Always set finalURL in onStartRequest since it can change.