mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 776764 - Allow permissionDB parent directory to not be the default profile directory. r=fabrice
This commit is contained in:
parent
b4f0c450b3
commit
48bb60b4c6
@ -22,7 +22,7 @@ DirectoryProvider.prototype = {
|
||||
|
||||
getFile: function dp_getFile(prop, persistent) {
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
let localProps = ["cachePDir", "webappsDir", "PrefD", "indexedDBPDir"];
|
||||
let localProps = ["cachePDir", "webappsDir", "PrefD", "indexedDBPDir", "permissionDBPDir"];
|
||||
if (localProps.indexOf(prop) != -1) {
|
||||
prop.persistent = true;
|
||||
let file = Cc["@mozilla.org/file/local;1"]
|
||||
|
@ -303,11 +303,13 @@ nsresult
|
||||
nsPermissionManager::InitDB(bool aRemoveFile)
|
||||
{
|
||||
nsCOMPtr<nsIFile> permissionsFile;
|
||||
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(permissionsFile));
|
||||
if (!permissionsFile)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
nsresult rv = NS_GetSpecialDirectory(NS_APP_PERMISSION_PARENT_DIR, getter_AddRefs(permissionsFile));
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(permissionsFile));
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsresult rv = permissionsFile->AppendNative(NS_LITERAL_CSTRING(kPermissionsFileName));
|
||||
rv = permissionsFile->AppendNative(NS_LITERAL_CSTRING(kPermissionsFileName));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aRemoveFile) {
|
||||
|
@ -88,4 +88,6 @@
|
||||
#define NS_APP_STORAGE_50_FILE "UStor" // sqlite database used as mozStorage profile db
|
||||
|
||||
#define NS_APP_INDEXEDDB_PARENT_DIR "indexedDBPDir"
|
||||
|
||||
#define NS_APP_PERMISSION_PARENT_DIR "permissionDBPDir"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user