Bug 1176159 (part 1) - Remove pref_SaveTypes. r=bsmedberg.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 18 Jun 2015 16:44:35 -0700
changeset 282304 f09e76d633f5306b37072716f3ed931019b3b5aa
parent 282303 63543a32a11dfbd36e06b663630251c6bf2e9a4c
child 282305 3ee7b443eb5efb43e2d7f8e593a492b3f9e2ba36
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1176159
milestone41.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 1176159 (part 1) - Remove pref_SaveTypes. r=bsmedberg. Because SAVE_ALL is the only value ever used.
modules/libpref/Preferences.cpp
modules/libpref/prefapi.cpp
modules/libpref/prefapi_private_data.h
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -955,17 +955,16 @@ Preferences::WritePrefFile(nsIFile* aFil
   rv = NS_NewBufferedOutputStream(getter_AddRefs(outStream), outStreamSink, 4096);
   if (NS_FAILED(rv)) 
       return rv;  
 
   nsAutoArrayPtr<char*> valueArray(new char*[gHashTable->EntryCount()]);
   memset(valueArray, 0, gHashTable->EntryCount() * sizeof(char*));
   pref_saveArgs saveArgs;
   saveArgs.prefArray = valueArray;
-  saveArgs.saveTypes = SAVE_ALL;
 
   // get the lines that we're supposed to be writing to the file
   PL_DHashTableEnumerate(gHashTable, pref_savePref, &saveArgs);
 
   /* Sort the preferences to make a readable file on disk */
   NS_QuickSort(valueArray, gHashTable->EntryCount(), sizeof(char *),
                pref_CompareStrings, nullptr);
 
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -338,23 +338,18 @@ pref_savePref(PLDHashTable *table, PLDHa
     if (PREF_HAS_USER_VALUE(pref) &&
         (pref_ValueChanged(pref->defaultPref,
                            pref->userPref,
                            (PrefType) PREF_TYPE(pref)) ||
          !(pref->flags & PREF_HAS_DEFAULT) ||
          pref->flags & PREF_STICKY_DEFAULT)) {
         sourcePref = &pref->userPref;
     } else {
-        if (argData->saveTypes == SAVE_ALL_AND_DEFAULTS) {
-            prefPrefix.AssignLiteral("pref(\"");
-            sourcePref = &pref->defaultPref;
-        }
-        else
-            // do not save default prefs that haven't changed
-            return PL_DHASH_NEXT;
+        // do not save default prefs that haven't changed
+        return PL_DHASH_NEXT;
     }
 
     // strings are in quotes!
     if (pref->flags & PREF_STRING) {
         prefValue = '\"';
         str_escape(sourcePref->stringVal, prefValue);
         prefValue += '\"';
     }
--- a/modules/libpref/prefapi_private_data.h
+++ b/modules/libpref/prefapi_private_data.h
@@ -14,22 +14,19 @@ extern PLDHashTable* gHashTable;
 extern bool gDirty;
 
 namespace mozilla {
 namespace dom {
 class PrefSetting;
 }
 }
 
-enum pref_SaveTypes { SAVE_NONSHARED, SAVE_SHARED, SAVE_ALL, SAVE_ALL_AND_DEFAULTS };
-
 // Passed as the arg to pref_savePref
 struct pref_saveArgs {
   char **prefArray;
-  pref_SaveTypes saveTypes;
 };
 
 PLDHashOperator
 pref_savePref(PLDHashTable *table, PLDHashEntryHdr *heh, uint32_t i, void *arg);
 
 PLDHashOperator
 pref_GetPrefs(PLDHashTable *table,
               PLDHashEntryHdr *heh, uint32_t i, void *arg);