B2G/gecko/dom/apps/src/Webapps.jsm
// Removes the directory we created, and sends an error to the DOM side.
Removes the directory we created, and sends an error to the DOM side.
Removes the directory we created and sends an error to the DOM side .
function cleanup(aError) {
      debug("Cleanup: " + aError);
      let dir = FileUtils.getDir("TmpD", ["webapps", id], true, true);
      try {
        dir.remove(true);
      } catch (e) { }
      if (app.isCanceling) {
        delete app.isCanceling;
        return;
      }
      let download = AppDownloadManager.get(aApp.manifestURL);
      app.downloading = false;
      app.installState = download ? download.previousState
                                  : aIsUpdate ? "installed"
                                  : "pending";
      if (app.staged) {
        delete app.staged;
      }
      self.broadcastMessage("Webapps:PackageEvent",
                            { type: "error",
                              manifestURL:  aApp.manifestURL,
                              error: aError,
                              app: app });
      self._saveApps();
      AppDownloadManager.remove(aApp.manifestURL);
    }
function cleanup ( aError ) { debug ( "Cleanup: " + aError ) ; let dir = FileUtils . getDir ( "TmpD" , [ "webapps" , id ] , true , true ) ; try { dir . remove ( true ) ; } catch ( e ) { } if ( app . isCanceling ) { delete app . isCanceling ; return ; } let download = AppDownloadManager . get ( aApp . manifestURL ) ; app . downloading = false ; app . installState = download ? download . previousState : aIsUpdate ? "installed" : "pending" ; if ( app . staged ) { delete app . staged ; } self . broadcastMessage ( "Webapps:PackageEvent" , { type : "error" , manifestURL : aApp . manifestURL , error : aError , app : app } ) ; self . _saveApps ( ) ; AppDownloadManager . remove ( aApp . manifestURL ) ; }
Removes the directory we created, and sends an error to the DOM side.
Removes the directory we created and sends an error to the DOM side .
// We avoid notifying the error to the DOM side if the app download // was cancelled via cancelDownload, which already sends its own // notification. // If there were not enough storage to download the package we // won't have a record of the download details, so we just set the // installState to 'pending' at first download and to 'installed' when // updating.