Bug 650399 - All webapps should use the same webapp database. r=mfinkle

This commit is contained in:
Wes Johnston 2012-08-15 17:02:15 -04:00
parent 4fe40c7af8
commit ceed4adc3e
2 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,8 @@ XPCOMUtils.defineLazyGetter(this, "msgmgr", function() {
#ifdef MOZ_WIDGET_GONK
const DIRECTORY_NAME = "webappsDir";
#elifdef ANDROID
const DIRECTORY_NAME = "webappsDir";
#else
// If we're executing in the context of the webapp runtime, the data files
// are in a different directory (currently the Firefox profile that installed

View File

@ -14,6 +14,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const NS_APP_CACHE_PARENT_DIR = "cachePDir";
const XRE_UPDATE_ROOT_DIR = "UpdRootD";
const ENVVAR_UPDATE_DIR = "UPDATES_DIRECTORY";
const WEBAPPS_DIR = "webappsDir";
function DirectoryProvider() {}
@ -27,6 +28,13 @@ DirectoryProvider.prototype = {
let dirsvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
let profile = dirsvc.get("ProfD", Ci.nsIFile);
return profile;
} else if (prop == WEBAPPS_DIR) {
// returns the folder that should hold the webapps database file
// For fennec we will store that in the root profile folder so that all
// webapps can easily access it
let dirsvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
let profile = dirsvc.get("ProfD", Ci.nsIFile);
return profile.parent;
} else if (prop == XRE_UPDATE_ROOT_DIR) {
let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
if (env.exists(ENVVAR_UPDATE_DIR)) {