Bug 1430023 - Get rid of some remaining localstore.rdf code. r=mossop
authorMarco Bonardo <mbonardo@mozilla.com>
Wed, 09 May 2018 10:49:35 +0200
changeset 472630 ba79a9e472c0542e234de2afa4c124ac92c9237e
parent 472629 e6013642ac9da06a5a8a615122c0168b2355783e
child 472631 51b77a6408786769c5ec8695a13d5e3591f6fd85
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1430023
milestone62.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 1430023 - Get rid of some remaining localstore.rdf code. r=mossop MozReview-Commit-ID: LqqSsb2h1Yv
testing/talos/talos/base_profile/localstore.rdf
testing/talos/talos/mtio-whitelist.json
testing/talos/talos/xtalos/xperf_whitelist.json
toolkit/components/build/nsToolkitCompsCID.h
toolkit/components/xulstore/tests/chrome/animals.rdf
toolkit/components/xulstore/tests/chrome/chrome.ini
toolkit/components/xulstore/tests/xpcshell/localstore.rdf
toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
toolkit/components/xulstore/tests/xpcshell/xpcshell.ini
toolkit/xre/nsAppRunner.h
toolkit/xre/nsXREDirProvider.cpp
xpcom/io/nsAppDirectoryServiceDefs.h
deleted file mode 100755
--- a/testing/talos/talos/base_profile/localstore.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
-         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
-                   width="1024"
-                   height="768"
-                   sizemode="normal"
-                   screenX="0"
-                   screenY="0" />
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul">
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#toolbar-menubar"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
-  </RDF:Description>
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-box"
-                   sidebarcommand=""
-                   width=""
-                   src="" />
-</RDF:RDF>
--- a/testing/talos/talos/mtio-whitelist.json
+++ b/testing/talos/talos/mtio-whitelist.json
@@ -130,18 +130,16 @@
  "{profile}\\extensions\\talos-powers@mozilla.org\\install.rdf": {},
  "{profile}\\extensions\\talos-powers@mozilla.org\\plugins": {},
  "{profile}\\extensions\\talos-powers@mozilla.org\\searchplugins": {},
  "{profile}\\favicons.sqlite": {},
  "{profile}\\favicons.sqlite-journal": {},
  "{profile}\\favicons.sqlite-shm": {},
  "{profile}\\favicons.sqlite-wal": {},
  "{profile}\\key3.db": {},
- "{profile}\\localstore-1.rdf": {},
- "{profile}\\localstore.rdf": {},
  "{profile}\\places.sqlite": {},
  "{profile}\\places.sqlite-journal": {},
  "{profile}\\places.sqlite-shm": {},
  "{profile}\\places.sqlite-wal": {},
  "{profile}\\pluginreg.dat": {},
  "{profile}\\pluginreg.dat.tmp": {},
  "{profile}\\plugins": {},
  "{profile}\\prefs-1.js": {},
--- a/testing/talos/talos/xtalos/xperf_whitelist.json
+++ b/testing/talos/talos/xtalos/xperf_whitelist.json
@@ -396,22 +396,16 @@
     "maxbytes": 32768
   },
   "{profile}\\key4.db": {
     "mincount": 0,
     "maxcount": 16,
     "minbytes": 0,
     "maxbytes": 196936
   },
-  "{profile}\\localstore.rdf": {
-    "mincount": 2,
-    "maxcount": 2,
-    "minbytes": 8192,
-    "maxbytes": 8192
-  },
   "{profile}\\permissions.sqlite": {
     "mincount": 14,
     "maxcount": 14,
     "minbytes": 4424,
     "maxbytes": 4424
   },
   "{profile}\\pkcs11.txt": {
     "mincount": 0,
--- a/toolkit/components/build/nsToolkitCompsCID.h
+++ b/toolkit/components/build/nsToolkitCompsCID.h
@@ -28,19 +28,16 @@
   "@mozilla.org/satchel/form-history;1"
 
 #define NS_FORMFILLCONTROLLER_CONTRACTID \
   "@mozilla.org/satchel/form-fill-controller;1"
 
 #define NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID \
   "@mozilla.org/autocomplete/search;1?name=form-history"
 
-#define NS_GLOBALHISTORY_DATASOURCE_CONTRACTID \
-  "@mozilla.org/rdf/datasource;1?name=history"
-
 #define NS_TYPEAHEADFIND_CONTRACTID \
     "@mozilla.org/typeaheadfind;1"
 
 #define NS_PARENTALCONTROLSSERVICE_CONTRACTID \
     "@mozilla.org/parental-controls-service;1"
 
 #define NS_URLCLASSIFIERPREFIXSET_CONTRACTID \
   "@mozilla.org/url-classifier/prefixset;1"
deleted file mode 100644
--- a/toolkit/components/xulstore/tests/chrome/animals.rdf
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#"
-         xmlns:ANIMALS="http://www.some-fictitious-zoo.com/rdf#">
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/arachnids">
-     <ANIMALS:name>Arachnids</ANIMALS:name>
-   </ANIMALS:Class>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/arachnids/tarantula">
-         <ANIMALS:name>Tarantula</ANIMALS:name>
-       </RDF:Description>
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/birds">
-     <ANIMALS:name>Birds</ANIMALS:name>
-   </ANIMALS:Class>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/emu">
-         <ANIMALS:name>Emu</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/barnowl">
-         <ANIMALS:name>Barn Owl</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/raven">
-         <ANIMALS:name>Raven</ANIMALS:name>
-       </RDF:Description>
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/crustaceans">
-     <ANIMALS:name>Crustaceans</ANIMALS:name>
-   </ANIMALS:Class>
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/fish">
-     <ANIMALS:name>Fish</ANIMALS:name>
-   </ANIMALS:Class>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/fish/cod">
-         <ANIMALS:name>Cod</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/fish/swordfish">
-         <ANIMALS:name>Swordfish</ANIMALS:name>
-       </RDF:Description>
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/mammals">
-     <ANIMALS:name>Mammals</ANIMALS:name>
-   </ANIMALS:Class>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/lion">
-         <ANIMALS:name>Lion</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/hippopotamus">
-         <ANIMALS:name>HIPPOPOTAMUS</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/africanelephant">
-         <ANIMALS:name>African Elephant</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/llama">
-         <ANIMALS:name>LLAMA</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/polarbear">
-         <ANIMALS:name>Polar Bear</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/aardvark">
-         <ANIMALS:name>aardvark</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/ninebandedarmadillo">
-         <ANIMALS:name>Nine-banded Armadillo</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/gorilla">
-         <ANIMALS:name>Gorilla</ANIMALS:name>
-       </RDF:Description>
-
-   <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/reptiles">
-     <ANIMALS:name>Reptiles</ANIMALS:name>
-   </ANIMALS:Class>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/reptiles/anaconda">
-         <ANIMALS:name>Anaconda</ANIMALS:name>
-       </RDF:Description>
-
-       <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/reptiles/chameleon">
-         <ANIMALS:name>Chameleon</ANIMALS:name>
-       </RDF:Description>
-
-  <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/some-animals" ANIMALS:name="Zoo Animals">
-    <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/arachnids"/>
-    <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds"/>
-  </RDF:Seq>
-
-  <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/all-animals" ANIMALS:name="Zoo Animals">
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/arachnids">
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/arachnids/tarantula"/>
-      </RDF:Seq>
-    </RDF:li>
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/birds">
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/emu"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/barnowl"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/raven"/>
-      </RDF:Seq>
-    </RDF:li>
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/crustaceans"/>
-    </RDF:li>
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/fish">
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/fish/cod"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/fish/swordfish"/>
-      </RDF:Seq>
-    </RDF:li>
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/mammals">
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/lion"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/hippopotamus"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/africanelephant"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/llama"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/polarbear"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/aardvark"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/ninebandedarmadillo"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/gorilla"/>
-      </RDF:Seq>
-    </RDF:li>
-    <RDF:li>
-      <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/reptiles">
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/reptiles/anaconda"/>
-        <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/reptiles/chameleon"/>
-      </RDF:Seq>
-    </RDF:li>
-  </RDF:Seq>
-
-</RDF:RDF>
--- a/toolkit/components/xulstore/tests/chrome/chrome.ini
+++ b/toolkit/components/xulstore/tests/chrome/chrome.ini
@@ -1,6 +1,5 @@
 [DEFAULT]
 support-files =
   window_persistence.xul
-  animals.rdf
 
 [test_persistence.xul]
deleted file mode 100644
--- a/toolkit/components/xulstore/tests/xpcshell/localstore.rdf
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
-         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-title"
-                   value="" />
-  <RDF:Description RDF:about="about:config#prefCol"
-                   ordinal="1"
-                   sortDirection="ascending" />
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul#addon-bar"
-                   collapsed="true" />
-  <RDF:Description RDF:about="about:config">
-    <NC:persist RDF:resource="about:config#prefCol"/>
-    <NC:persist RDF:resource="about:config#lockCol"/>
-    <NC:persist RDF:resource="about:config#typeCol"/>
-    <NC:persist RDF:resource="about:config#valueCol"/>
-  </RDF:Description>
-  <RDF:Description RDF:about="about:config#lockCol"
-                   ordinal="3" />
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul">
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#addon-bar"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
-    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
-  </RDF:Description>
-  <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
-                   width="994"
-                   height="768"
-                   screenX="4"
-                   screenY="22"
-                   sizemode="normal" />
-</RDF:RDF>
--- a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
+++ b/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
@@ -52,51 +52,19 @@ function getAttributes(uri, id) {
 }
 
 function checkArrays(a, b) {
   a.sort();
   b.sort();
   Assert.equal(a.toString(), b.toString());
 }
 
-function checkOldStore() {
-  checkArrays([], getIDs(browserURI));
-  checkArrays([], getAttributes(browserURI, "addon-bar"));
-  checkArrays([],
-              getAttributes(browserURI, "main-window"));
-  checkArrays([], getAttributes(browserURI, "sidebar-title"));
-
-  checkValue(browserURI, "addon-bar", "collapsed", "");
-  checkValue(browserURI, "main-window", "width", "");
-  checkValue(browserURI, "main-window", "height", "");
-  checkValue(browserURI, "main-window", "screenX", "");
-  checkValue(browserURI, "main-window", "screenY", "");
-  checkValue(browserURI, "main-window", "sizemode", "");
-  checkValue(browserURI, "sidebar-title", "value", "");
-
-  checkArrays([], getIDs(aboutURI));
-  checkArrays([], getAttributes(aboutURI, "lockCol"));
-  checkArrays([], getAttributes(aboutURI, "prefCol"));
-
-  checkValue(aboutURI, "prefCol", "ordinal", "");
-  checkValue(aboutURI, "prefCol", "sortDirection", "");
-  checkValue(aboutURI, "lockCol", "ordinal", "");
-}
-
-add_task(async function testImport() {
-  let src = "localstore.rdf";
-  let dst = OS.Path.join(OS.Constants.Path.profileDir, src);
-
-  await OS.File.copy(src, dst);
-
-  // Test to make sure that localstore.rdf isn't imported any more.
+add_task(async function setup() {
+  // Set a value that a future test depends on manually
   XULStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
-  checkOldStore();
-
-  // Set a value that a future test depends on manually
   XULStore.setValue(browserURI, "main-window", "width", "994");
 });
 
 add_task(async function testTruncation() {
   let dos = Array(8192).join("~");
   // Long id names should trigger an exception
   Assert.throws(() => XULStore.setValue(browserURI, dos, "foo", "foo"), /NS_ERROR_ILLEGAL_VALUE/);
 
--- a/toolkit/components/xulstore/tests/xpcshell/xpcshell.ini
+++ b/toolkit/components/xulstore/tests/xpcshell/xpcshell.ini
@@ -1,6 +1,4 @@
 [DEFAULT]
 skip-if = toolkit == 'android'
-support-files =
-  localstore.rdf
 
 [test_XULStore.js]
--- a/toolkit/xre/nsAppRunner.h
+++ b/toolkit/xre/nsAppRunner.h
@@ -22,21 +22,16 @@
 #else
 #define MAXPATHLEN 1024
 #endif
 #endif
 
 #include "nsStringFwd.h"
 #include "nsXULAppAPI.h"
 
-// This directory service key is a lot like NS_APP_LOCALSTORE_50_FILE,
-// but it is always the "main" localstore file, even when we're in safe mode
-// and we load localstore from somewhere else.
-#define NS_LOCALSTORE_UNSAFE_FILE "LStoreS"
-
 class nsINativeAppSupport;
 class nsXREDirProvider;
 class nsIToolkitProfileService;
 class nsIFile;
 class nsIProfileLock;
 class nsIProfileUnlocker;
 class nsIFactory;
 
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -510,29 +510,16 @@ nsXREDirProvider::GetFile(const char* aP
 
   if (NS_SUCCEEDED(GetProfileDir(getter_AddRefs(file)))) {
     if (!strcmp(aProperty, NS_APP_PREFS_50_DIR)) {
       rv = NS_OK;
     }
     else if (!strcmp(aProperty, NS_APP_PREFS_50_FILE)) {
       rv = file->AppendNative(NS_LITERAL_CSTRING("prefs.js"));
     }
-    else if (!strcmp(aProperty, NS_LOCALSTORE_UNSAFE_FILE)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf"));
-    }
-    else if (!strcmp(aProperty, NS_APP_LOCALSTORE_50_FILE)) {
-      if (gSafeMode) {
-        rv = file->AppendNative(NS_LITERAL_CSTRING("localstore-safe.rdf"));
-        file->Remove(false);
-      }
-      else {
-        rv = file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf"));
-        ensureFilePermissions = true;
-      }
-    }
     else if (!strcmp(aProperty, NS_APP_PREFS_OVERRIDE_DIR)) {
       rv = mProfileDir->Clone(getter_AddRefs(file));
       nsresult tmp = file->AppendNative(NS_LITERAL_CSTRING(PREF_OVERRIDE_DIRNAME));
       if (NS_FAILED(tmp)) {
         rv = tmp;
       }
       tmp = EnsureDirectoryExists(file);
       if (NS_FAILED(tmp)) {
--- a/xpcom/io/nsAppDirectoryServiceDefs.h
+++ b/xpcom/io/nsAppDirectoryServiceDefs.h
@@ -60,17 +60,16 @@
 #define NS_APP_PREFS_DEFAULTS_DIR_LIST          "PrefDL"
 #define NS_APP_PREFS_OVERRIDE_DIR               "PrefDOverride" // Directory for per-profile defaults
 
 #define NS_APP_USER_PROFILE_50_DIR              "ProfD"
 #define NS_APP_USER_PROFILE_LOCAL_50_DIR        "ProfLD"
 
 #define NS_APP_USER_CHROME_DIR                  "UChrm"
 
-#define NS_APP_LOCALSTORE_50_FILE               "LclSt"
 #define NS_APP_USER_PANELS_50_FILE              "UPnls"
 #define NS_APP_CACHE_PARENT_DIR                 "cachePDir"
 
 #define NS_APP_INSTALL_CLEANUP_DIR              "XPIClnupD"  //location of xpicleanup.dat xpicleanup.exe
 
 #define NS_APP_INDEXEDDB_PARENT_DIR             "indexedDBPDir"
 
 #define NS_APP_PERMISSION_PARENT_DIR            "permissionDBPDir"