From d3da34b11abc129645287025baa4f0771ef6d6bf Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 29 Aug 2013 10:00:33 -0400 Subject: [PATCH] Bug 910391 - Remove offline cache observer parameter from confirmInstall. r=fabrice --- browser/modules/webappsUI.jsm | 2 +- dom/apps/src/Webapps.jsm | 19 +++++-------------- mobile/android/chrome/content/browser.js | 2 +- webapprt/WebappsHandler.jsm | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/browser/modules/webappsUI.jsm b/browser/modules/webappsUI.jsm index 554bc9e7f4db..2acd30a6fa5f 100644 --- a/browser/modules/webappsUI.jsm +++ b/browser/modules/webappsUI.jsm @@ -137,7 +137,7 @@ this.webappsUI = { localDir = app.appProfile.localDir; } - DOMApplicationRegistry.confirmInstall(aData, localDir, null, + DOMApplicationRegistry.confirmInstall(aData, localDir, (aManifest) => { Task.spawn(function() { try { diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index ccbb95b9151a..eeca9499d7c0 100644 --- a/dom/apps/src/Webapps.jsm +++ b/dom/apps/src/Webapps.jsm @@ -1130,7 +1130,7 @@ this.DOMApplicationRegistry = { if (manifest.appcache_path) { debug("appcache found"); - this.startOfflineCacheDownload(manifest, app, null, null, isUpdate); + this.startOfflineCacheDownload(manifest, app, null, isUpdate); } else { // hosted app with no appcache, nothing to do, but we fire a // downloaded event @@ -1280,10 +1280,7 @@ this.DOMApplicationRegistry = { }).bind(this)); }, - startOfflineCacheDownload: function startOfflineCacheDownload(aManifest, aApp, - aProfileDir, - aOfflineCacheObserver, - aIsUpdate) { + startOfflineCacheDownload: function(aManifest, aApp, aProfileDir, aIsUpdate) { if (!aManifest.appcache_path) { return; } @@ -1320,9 +1317,6 @@ this.DOMApplicationRegistry = { AppDownloadManager.add(aApp.manifestURL, download); cacheUpdate.addObserver(new AppcacheObserver(aApp), false); - if (aOfflineCacheObserver) { - cacheUpdate.addObserver(aOfflineCacheObserver, false); - } }).bind(this)); }, @@ -1928,8 +1922,7 @@ this.DOMApplicationRegistry = { if (cacheDownload) { this.startOfflineCacheDownload(cacheDownload.manifest, cacheDownload.app, - cacheDownload.profileDir, - cacheDownload.offlineCacheObserver); + cacheDownload.profileDir); delete this.queuedDownload[aManifestURL]; return; @@ -1987,8 +1980,7 @@ this.DOMApplicationRegistry = { } }, - confirmInstall: function(aData, aProfileDir, aOfflineCacheObserver, - aInstallSuccessCallback) { + confirmInstall: function(aData, aProfileDir, aInstallSuccessCallback) { let isReinstall = false; let app = aData.app; app.removable = true; @@ -2086,8 +2078,7 @@ this.DOMApplicationRegistry = { this.queuedDownload[app.manifestURL] = { manifest: manifest, app: appObject, - profileDir: aProfileDir, - offlineCacheObserver: aOfflineCacheObserver + profileDir: aProfileDir } } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index f823a11c62c5..7eaab9052b54 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6807,7 +6807,7 @@ var WebappsUI = { file.initWithPath(profilePath); let self = this; - DOMApplicationRegistry.confirmInstall(aData, file, null, + DOMApplicationRegistry.confirmInstall(aData, file, function (aManifest) { let localeManifest = new ManifestHelper(aManifest, aData.app.origin); diff --git a/webapprt/WebappsHandler.jsm b/webapprt/WebappsHandler.jsm index f633f87d53a3..f1308e212d7d 100644 --- a/webapprt/WebappsHandler.jsm +++ b/webapprt/WebappsHandler.jsm @@ -67,7 +67,7 @@ this.WebappsHandler = { localDir = shell.appProfile.localDir; } - DOMApplicationRegistry.confirmInstall(data, localDir, null, + DOMApplicationRegistry.confirmInstall(data, localDir, function (aManifest) { WebappsInstaller.install(data, aManifest); }