Bug 746121 - Updating the DirectoryProvider to look for user.js on the sdcard. r=vingtetun a=b2g-only
authorEtienne Segonzac <etienne@segonzac.info>
Wed, 18 Apr 2012 12:47:05 +0200
changeset 95278 70689bad715673c3da3393e4358f75560296a91f
parent 95277 76c80a198ebae612b4d181f3ade781dd7e18d4c1
child 95279 1d3aea7115d36068c375f00e2d3048f734a4da7b
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun, b2g-only
bugs746121
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746121 - Updating the DirectoryProvider to look for user.js on the sdcard. r=vingtetun a=b2g-only
b2g/components/DirectoryProvider.js
--- a/b2g/components/DirectoryProvider.js
+++ b/b2g/components/DirectoryProvider.js
@@ -5,33 +5,34 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
-const OFFLINE_PROFILE_DIR = "/data/local"
+const LOCAL_DIR = "/data/local";
 
 function DirectoryProvider() {
 }
 
 DirectoryProvider.prototype = {
   classID: Components.ID("{9181eb7c-6f87-11e1-90b1-4f59d80dd2e5}"),
-  
+
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider]),
 
   getFile: function dp_getFile(prop, persistent) {
 #ifdef MOZ_WIDGET_GONK
-    if (prop == "cachePDir" || prop == "webappsDir") {
+    let localProps = ["cachePDir", "webappsDir", "PrefD"];
+    if (localProps.indexOf(prop) != -1) {
       prop.persistent = true;
       let file = Cc["@mozilla.org/file/local;1"]
                    .createInstance(Ci.nsILocalFile)
-      file.initWithPath(OFFLINE_PROFILE_DIR);
+      file.initWithPath(LOCAL_DIR);
       return file;
     }
 #endif
 
     return null;
   }
 };