Backed out changeset 2bfef5c6f2a7: Bug 1415567 - Port bug 1414096 which was backed out. a=jorgk
authorJorg K <jorgk@jorgk.com>
Wed, 08 Nov 2017 23:15:41 +0100
changeset 29340 497ee9e16aff5daeb90d253773876185893f1e62
parent 29339 3617ae4c65c86ddcc56f0b2b8651e7bbf73b0132
child 29341 7cf42e74929f17259b04eb45fe8e5bcc2dea9ec5
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1415567, 1414096
backs out2bfef5c6f2a706f63de9cf896ac2d8527a475a53
Backed out changeset 2bfef5c6f2a7: Bug 1415567 - Port bug 1414096 which was backed out. a=jorgk
chat/components/src/imAccounts.js
chat/components/src/imCore.js
chat/modules/jsProtoHelper.jsm
chat/protocols/xmpp/xmpp.jsm
editor/ui/composer/content/editor.js
editor/ui/composer/content/editorUtilities.js
editor/ui/composer/content/publishprefs.js
im/content/account.js
im/content/joinchat.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/im/content/joinchat.js
mail/components/im/imIncomingServer.js
mail/components/preferences/attachmentReminder.js
mailnews/extensions/smime/content/certFetchingStatus.js
suite/browser/nsBrowserContentHandler.js
suite/common/utilityOverlay.js
suite/feeds/src/FeedWriter.js
suite/feeds/src/WebContentConverter.js
suite/modules/test/unit/test_browser_sanitizer.js
--- a/chat/components/src/imAccounts.js
+++ b/chat/components/src/imAccounts.js
@@ -124,22 +124,27 @@ function imAccount(aKey, aName, aPrplId)
 
   this.id = aKey;
   this.numericId = parseInt(aKey.substr(kAccountKeyPrefix.length));
   gAccountsService._keepAccount(this);
   this.prefBranch = Services.prefs.getBranch(kPrefAccountPrefix + aKey + ".");
 
   if (aName) {
     this.name = aName;
-    this.prefBranch.setStringPref(kPrefAccountName, aName);
+    let str = Cc["@mozilla.org/supports-string;1"]
+              .createInstance(Ci.nsISupportsString);
+    str.data = aName;
+    this.prefBranch.setComplexValue(kPrefAccountName, Ci.nsISupportsString,
+                                    str);
 
     this.firstConnectionState = Ci.imIAccount.FIRST_CONNECTION_UNKNOWN;
   }
   else {
-    this.name = this.prefBranch.getStringPref(kPrefAccountName);
+    this.name = this.prefBranch.getComplexValue(kPrefAccountName,
+                                                Ci.nsISupportsString).data;
   }
 
   let prplId = aPrplId;
   if (prplId)
     this.prefBranch.setCharPref(kPrefAccountPrpl, prplId);
   else
     prplId = this.prefBranch.getCharPref(kPrefAccountPrpl);
 
@@ -166,17 +171,18 @@ function imAccount(aKey, aName, aPrplId)
     this.firstConnectionState = Ci.imIAccount.FIRST_CONNECTION_CRASHED;
 
   Services.logins.initializationPromise.then(() => {
     // Try to convert old passwords stored in the preferences.
     // Don't try too hard if the user has canceled a master password prompt:
     // we don't want to display several of theses prompts at startup.
     if (gConvertingOldPasswords && !this.protocol.noPassword) {
       try {
-        let password = this.prefBranch.getStringPref(kPrefAccountPassword);
+        let password = this.prefBranch.getComplexValue(kPrefAccountPassword,
+                                                       Ci.nsISupportsString).data;
         if (password && !this.password)
           this.password = password;
       } catch (e) { /* No password saved in the prefs for this account. */ }
     }
 
     // Check for errors that should prevent connection attempts.
     if (this._passwordRequired && !this.password)
       this._connectionErrorReason = Ci.imIAccount.ERROR_MISSING_PASSWORD;
@@ -227,17 +233,18 @@ imAccount.prototype = {
       this._finishedAutoLogin();
       this.timeOfLastConnect = Date.now();
       if (this.firstConnectionState != Ci.imIAccount.FIRST_CONNECTION_OK)
         this.firstConnectionState = Ci.imIAccount.FIRST_CONNECTION_OK;
       delete this.connectionStateMsg;
 
       if (this.canJoinChat &&
           this.prefBranch.prefHasUserValue(kPrefAccountAutoJoin)) {
-        let autojoin = this.prefBranch.getStringPref(kPrefAccountAutoJoin);
+        let autojoin = this.prefBranch.getComplexValue(
+          kPrefAccountAutoJoin, Ci.nsISupportsString).data;
         if (autojoin) {
           for (let room of autojoin.trim().split(/,\s*/)) {
             if (room)
               this.joinChat(this.getChatRoomDefaultFieldValues(room));
           }
         }
       }
     }
@@ -468,25 +475,30 @@ imAccount.prototype = {
   },
 
   _sendUpdateNotification: function() {
     this._sendNotification("account-updated");
   },
 
   set alias(val) {
     if (val) {
-      this.prefBranch.setStringPref(kPrefAccountAlias, val);
+      let str = Cc["@mozilla.org/supports-string;1"]
+                .createInstance(Ci.nsISupportsString);
+      str.data = val;
+      this.prefBranch.setComplexValue(kPrefAccountAlias, Ci.nsISupportsString,
+                                      str);
     }
     else
       this.prefBranch.deleteBranch(kPrefAccountAlias);
     this._sendUpdateNotification();
   },
   get alias() {
     try {
-      return this.prefBranch.getStringPref(kPrefAccountAlias);
+      return this.prefBranch.getComplexValue(kPrefAccountAlias,
+                                             Ci.nsISupportsString).data;
     } catch (e) {
       return "";
     }
   },
 
   _password: "",
   get password() {
     if (this._password)
@@ -786,17 +798,21 @@ imAccount.prototype = {
   setInt: function(aName, aVal) {
     this.prefBranch.setIntPref(kAccountOptionPrefPrefix + aName, aVal);
     this._connectionInfoChanged();
     if (this.prplAccount)
       this.prplAccount.setInt(aName, aVal);
     SavePrefTimer.initTimer();
   },
   setString: function(aName, aVal) {
-    this.prefBranch.setStringPref(kAccountOptionPrefPrefix + aName, aVal);
+    let str = Cc["@mozilla.org/supports-string;1"]
+              .createInstance(Ci.nsISupportsString);
+    str.data = aVal;
+    this.prefBranch.setComplexValue(kAccountOptionPrefPrefix + aName,
+                                    Ci.nsISupportsString, str);
     this._connectionInfoChanged();
     if (this.prplAccount)
       this.prplAccount.setString(aName, aVal);
     SavePrefTimer.initTimer();
   },
   save: function() { SavePrefTimer.saveNow(); },
 
   get HTMLEnabled() { return this._ensurePrplAccount.HTMLEnabled; },
--- a/chat/components/src/imCore.js
+++ b/chat/components/src/imCore.js
@@ -209,20 +209,25 @@ UserStatus.prototype = {
       Services.console.logStringMessage("Invalid userIconFileName preference");
       return null;
     }
 
     return Services.io.newFileURI(file);
   },
 
   get displayName() {
-    return Services.prefs.getStringPref(kPrefUserDisplayname);
+    return Services.prefs.getComplexValue(kPrefUserDisplayname,
+                                          Ci.nsISupportsString).data;
   },
   set displayName(aDisplayName) {
-    Services.prefs.setStringPref(kPrefUserDisplayname, aDisplayName);
+    let str = Cc["@mozilla.org/supports-string;1"]
+              .createInstance(Ci.nsISupportsString);
+    str.data = aDisplayName;
+    Services.prefs.setComplexValue(kPrefUserDisplayname, Ci.nsISupportsString,
+                                   str);
     this._notifyObservers("user-display-name-changed", aDisplayName);
   },
 
   addObserver: function(aObserver) {
     if (!this._observers.includes(aObserver))
       this._observers.push(aObserver);
   },
   removeObserver: function(aObserver) {
--- a/chat/modules/jsProtoHelper.jsm
+++ b/chat/modules/jsProtoHelper.jsm
@@ -214,17 +214,17 @@ var GenericAccountPrototype = {
     return this.prefs.prefHasUserValue(aName) ?
            this.prefs["get" + aType + "Pref"](aName) :
            this.protocol._getOptionDefault(aName);
   },
   getInt: function(aName) { return this.getPref(aName, "Int"); },
   getBool: function(aName) { return this.getPref(aName, "Bool"); },
   getString: function(aName) {
     return this.prefs.prefHasUserValue(aName) ?
-             this.prefs.getStringPref(aName) :
+             this.prefs.getComplexValue(aName, Ci.nsISupportsString).data :
              this.protocol._getOptionDefault(aName);
   },
 
   get prefs() {
     return this._prefs ||
            (this._prefs = Services.prefs.getBranch("messenger.account." +
                                                    this.imAccount.id + ".options."));
   },
--- a/chat/protocols/xmpp/xmpp.jsm
+++ b/chat/protocols/xmpp/xmpp.jsm
@@ -1317,17 +1317,20 @@ var XMPPAccountPrototype = {
       // because while connected it's the jid of the session that's
       // interesting.
       this._jid = this._setJID(this._jid.domain, this._jid.node, resource);
     }
     else if (this._jid.resource) {
       // If there is a resource in the account name (inherited from libpurple),
       // migrate it to the pref so it appears correctly in the advanced account
       // options next time.
-      this.prefs.setStringPref("resource", this._jid.resource);
+      let str = Cc["@mozilla.org/supports-string;1"]
+                  .createInstance(Ci.nsISupportsString);
+      str.data = this._jid.resource;
+      this.prefs.setComplexValue("resource", Ci.nsISupportsString, str);
     }
 
     this._connection =
       new XMPPSession(this.getString("server") || this._jid.domain,
                       this.getInt("port") || 5222,
                       this.getString("connection_security"), this._jid,
                       this.imAccount.password, this);
   },
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -2320,17 +2320,18 @@ function EditorSetDefaultPrefsAndDoctype
       editor.documentCharacterSet = prefCharsetString;
 
     // let's start by assuming we have an author in case we don't have the pref
 
     var prefAuthorString = null;
     let authorFound = domdoc.querySelector('meta[name="author"]');
     try
     {
-      prefAuthorString = Services.prefs.getStringPref("editor.author");
+      prefAuthorString = Services.prefs.getComplexValue("editor.author",
+                                                        Components.interfaces.nsISupportsString).data;
     }
     catch (ex) {}
     if (prefAuthorString && prefAuthorString != 0 && !authorFound && headelement)
     {
       // create meta tag with 2 attributes
       element = domdoc.createElement("meta");
       if (element)
       {
--- a/editor/ui/composer/content/editorUtilities.js
+++ b/editor/ui/composer/content/editorUtilities.js
@@ -390,25 +390,28 @@ function GetFileProtocolHandler()
 {
   let handler = Services.io.getProtocolHandler("file");
   return handler.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
 }
 
 function GetStringPref(name)
 {
   try {
-    return Services.prefs.getStringPref(name);
+    return Services.prefs.getComplexValue(name, Components.interfaces.nsISupportsString).data;
   } catch (e) {}
   return "";
 }
 
 function SetStringPref(aPrefName, aPrefValue)
 {
   try {
-    Services.prefs.setStringPref(aPrefName, aPrefValue);
+    let str = Components.classes["@mozilla.org/supports-string;1"]
+                        .createInstance(Components.interfaces.nsISupportsString);
+    str.data = aPrefValue;
+    Services.prefs.setComplexValue(aPrefName, Components.interfaces.nsISupportsString, str);
   }
   catch(e) {}
 }
 
 // Set initial directory for a filepicker from URLs saved in prefs
 function SetFilePickerDirectory(filePicker, fileType)
 {
   if (filePicker)
--- a/editor/ui/composer/content/publishprefs.js
+++ b/editor/ui/composer/content/publishprefs.js
@@ -718,28 +718,31 @@ function FillInMatchingPublishData(publi
 
 // Prefs that don't exist will through an exception,
 //  so just return an empty string
 function GetPublishStringPref(prefBranch, name)
 {
   if (prefBranch && name)
   {
     try {
-      return prefBranch.getStringPref(name);
+      return prefBranch.getComplexValue(name, Components.interfaces.nsISupportsString).data;
     } catch (e) {}
   }
   return "";
 }
 
 function SetPublishStringPref(prefBranch, name, value)
 {
   if (prefBranch && name)
   {
     try {
-        prefBranch.setStringPref(name, value);
+        var str = Components.classes["@mozilla.org/supports-string;1"]
+                            .createInstance(Components.interfaces.nsISupportsString);
+        str.data = value;
+        prefBranch.setComplexValue(name, Components.interfaces.nsISupportsString, str);
     } catch (e) {}
   }
 }
 
 // Assure that a publishing URL ends in "/", "=", "&" or "?"
 // Username and password should always be extracted as separate fields
 //  and are not allowed to remain embedded in publishing URL
 function FormatUrlForPublishing(url)
--- a/im/content/account.js
+++ b/im/content/account.js
@@ -34,17 +34,17 @@ var account = {
     if (protoId == "prpl-irc" || protoId == "prpl-jabber" ||
         protoId == "prpl-gtalk") {
       document.getElementById("optionalSeparator").hidden = false;
       document.getElementById("autojoinBox").hidden = false;
       var branch = Services.prefs.getBranch("messenger.account." +
                                             this.account.id + ".");
       if (branch.prefHasUserValue(autoJoinPref)) {
         document.getElementById("autojoin").value =
-          branch.getStringPref(autoJoinPref);
+          branch.getComplexValue(autoJoinPref, Ci.nsISupportsString).data;
       }
     }
 
 /* FIXME
     document.getElementById("newMailNotification").hidden =
       !this.proto.newMailNotification;
 */
 
@@ -126,17 +126,17 @@ var account = {
     if (this.prefs.prefHasUserValue(aOpt.name))
       return this.prefs.getIntPref(aOpt.name);
 
     return aOpt.getInt();
   },
 
   getString: function account_getString(aOpt) {
     if (this.prefs.prefHasUserValue(aOpt.name))
-      return this.prefs.getStringPref(aOpt.name);
+      return this.prefs.getComplexValue(aOpt.name, Ci.nsISupportsString).data;
 
     return aOpt.getString();
   },
 
   getListValue: function account_getListValue(aOpt) {
     if (this.prefs.prefHasUserValue(aOpt.name))
       return this.prefs.getCharPref(aOpt.name);
 
@@ -171,17 +171,20 @@ var account = {
 
     let protoId = this.proto.id;
     if (protoId == "prpl-irc" || protoId == "prpl-jabber" ||
         protoId == "prpl-gtalk") {
       var branch = Services.prefs.getBranch("messenger.account." +
                                             this.account.id + ".");
       var autojoin = this.getValue("autojoin");
       if (autojoin || branch.prefHasUserValue(autoJoinPref)) {
-        branch.setStringPref(autoJoinPref, autojoin);
+        let str = Cc["@mozilla.org/supports-string;1"]
+                    .createInstance(Ci.nsISupportsString);
+        str.data = autojoin;
+        branch.setComplexValue(autoJoinPref, Ci.nsISupportsString, str);
       }
     }
 
     if (this.proto.usePurpleProxy &&
         this.account.proxyInfo.key != this.proxy.key)
       this.account.proxyInfo = this.proxy;
 
     for (let opt of this.getProtoOptions()) {
--- a/im/content/joinchat.js
+++ b/im/content/joinchat.js
@@ -125,22 +125,25 @@ var joinChat = {
       if (nick)
         name += "/" + nick;
 
       let prefBranch =
         Services.prefs.getBranch("messenger.account." + account.id + ".");
       let autojoin = [];
       if (prefBranch.prefHasUserValue(autoJoinPref)) {
         let prefValue =
-          prefBranch.getStringPref(autoJoinPref);
+          prefBranch.getComplexValue(autoJoinPref, Ci.nsISupportsString).data;
         if (prefValue)
           autojoin = prefValue.split(",");
       }
 
       if (!autojoin.includes(name)) {
         autojoin.push(name);
-        prefBranch.setStringPref(autoJoinPref, autojoin.join(","));
+        let str = Cc["@mozilla.org/supports-string;1"]
+                    .createInstance(Ci.nsISupportsString);
+        str.data = autojoin.join(",");
+        prefBranch.setComplexValue(autoJoinPref, Ci.nsISupportsString, str);
       }
     }
 
     return true;
   }
 };
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -5655,17 +5655,18 @@ function enableInlineSpellCheck(aEnableI
 function getMailToolbox()
 {
   return document.getElementById("compose-toolbox");
 }
 
 function getPref(aPrefName, aIsComplex) {
   const Ci = Components.interfaces;
   if (aIsComplex) {
-    return Services.prefs.getStringPref(aPrefName);
+    return Services.prefs
+                   .getComplexValue(aPrefName, Ci.nsISupportsString).data;
   }
   switch (Services.prefs.getPrefType(aPrefName)) {
     case Ci.nsIPrefBranch.PREF_BOOL:
       return Services.prefs.getBoolPref(aPrefName);
     case Ci.nsIPrefBranch.PREF_INT:
       return Services.prefs.getIntPref(aPrefName);
     case Ci.nsIPrefBranch.PREF_STRING:
       return Services.prefs.getCharPref(aPrefName);
--- a/mail/components/im/content/joinchat.js
+++ b/mail/components/im/content/joinchat.js
@@ -134,22 +134,25 @@ var joinChat = {
       if (nick)
         name += "/" + nick;
 
       let prefBranch =
         Services.prefs.getBranch("messenger.account." + account.id + ".");
       let autojoin = [];
       if (prefBranch.prefHasUserValue(autoJoinPref)) {
         let prefValue =
-          prefBranch.getStringPref(autoJoinPref);
+          prefBranch.getComplexValue(autoJoinPref, Ci.nsISupportsString).data;
         if (prefValue)
           autojoin = prefValue.split(",");
       }
 
       if (!autojoin.includes(name)) {
         autojoin.push(name);
-        prefBranch.setStringPref(autoJoinPref, autojoin.join(","));
+        let str = Cc["@mozilla.org/supports-string;1"]
+                    .createInstance(Ci.nsISupportsString);
+        str.data = autojoin.join(",");
+        prefBranch.setComplexValue(autoJoinPref, Ci.nsISupportsString, str);
       }
     }
 
     return true;
   }
 };
--- a/mail/components/im/imIncomingServer.js
+++ b/mail/components/im/imIncomingServer.js
@@ -95,24 +95,27 @@ imIncomingServer.prototype = {
   },
   get alias() { return this.imAccount.alias; },
   set alias(aAlias) {
     this.imAccount.alias = aAlias;
   },
   get autojoin() {
     try {
       let prefName = "messenger.account." + this.imAccount.id + ".autoJoin";
-      return Services.prefs.getStringPref(prefName);
+      return Services.prefs.getComplexValue(prefName, Ci.nsISupportsString).data;
     } catch (e) {
       return "";
     }
   },
   set autojoin(aAutoJoin) {
     let prefName = "messenger.account." + this.imAccount.id + ".autoJoin";
-    Services.prefs.setStringPref(prefName, aAutoJoin);
+    let str = Cc["@mozilla.org/supports-string;1"]
+                .createInstance(Ci.nsISupportsString);
+    str.data = aAutoJoin;
+    Services.prefs.setComplexValue(prefName, Ci.nsISupportsString, str);
   },
 
   // This is used for user-visible advanced preferences.
   setUnicharValue: function(aPrefName, aValue) {
     if (aPrefName == "autojoin")
       this.autojoin = aValue;
     else if (aPrefName == "alias")
       this.alias = aValue;
@@ -127,17 +130,18 @@ imIncomingServer.prototype = {
     if (aPrefName == "alias")
       return this.alias;
     if (aPrefName == "password")
       return this.password;
 
     try {
       let prefName =
         "messenger.account." + this.imAccount.id + ".options." + aPrefName;
-      return Services.prefs.getStringPref(prefName);
+      return Services.prefs.getComplexValue(prefName,
+                                            Ci.nsISupportsString).data;
     } catch (x) {
       return this._getDefault(aPrefName);
     }
   },
   setBoolValue: function(aPrefName, aValue) {
     this.imAccount.setBool(aPrefName, aValue);
   },
   getBoolValue: function(aPrefName) {
--- a/mail/components/preferences/attachmentReminder.js
+++ b/mail/components/preferences/attachmentReminder.js
@@ -72,12 +72,15 @@ var gAttachmentReminderOptionsDialog = {
   {
     var keywordList = "";
     for (var i = 0; i < this.keywordListBox.getRowCount(); i++) {
       keywordList += this.keywordListBox.getItemAtIndex(i).getAttribute("value");
       if (i != this.keywordListBox.getRowCount() - 1)
         keywordList += ",";
     }
 
-    Services.prefs.setStringPref("mail.compose.attachment_reminder_keywords",
-                                 keywordList);
+    var str = Components.classes["@mozilla.org/supports-string;1"]
+                        .createInstance(Components.interfaces.nsISupportsString);
+    str.data = keywordList;
+    Services.prefs.setComplexValue("mail.compose.attachment_reminder_keywords",
+                                   Components.interfaces.nsISupportsString, str);
   }
 };
--- a/mailnews/extensions/smime/content/certFetchingStatus.js
+++ b/mailnews/extensions/smime/content/certFetchingStatus.js
@@ -40,17 +40,17 @@ function onLoad()
 
   setTimeout(search, 1);
 }
 
 function search()
 {
   // get the login to authenticate as, if there is one
   try {
-    gLogin = Services.prefs.getStringPref(gDirectoryPref + ".auth.dn");
+    gLogin = Services.prefs.getComplexValue(gDirectoryPref + ".auth.dn", Components.interfaces.nsISupportsString).data;
   } catch (ex) {
     // if we don't have this pref, no big deal
   }
 
   try {
     let url = Services.prefs.getCharPref(gDirectoryPref + ".uri");
 
     gLdapServerURL = Services.io
--- a/suite/browser/nsBrowserContentHandler.js
+++ b/suite/browser/nsBrowserContentHandler.js
@@ -81,17 +81,18 @@ function getHomePageGroup()
   var count = 0;
   try {
     count = Services.prefs.getIntPref("browser.startup.homepage.count");
   } catch (e) {
   }
 
   for (var i = 1; i < count; ++i) {
     try {
-      homePage += '\n' + Services.prefs.getStringPref("browser.startup.homepage." + i);
+      homePage += '\n' + Services.prefs.getComplexValue("browser.startup.homepage." + i,
+                                                        nsISupportsString).data;
     } catch (e) {
     }
   }
   return homePage;
 }
 
 function needHomePageOverride()
 {
@@ -145,17 +146,18 @@ function getURLToLoad()
   }
 
   try {
     switch (Services.prefs.getIntPref("browser.startup.page")) {
     case 1:
       return getHomePageGroup();
 
     case 2:
-      return Services.prefs.getStringPref("browser.history.last_page_visited");
+      return Services.prefs.getComplexValue("browser.history.last_page_visited",
+                                            nsISupportsString).data;
     }
   } catch (e) {
   }
 
   return "about:blank";
 }
 
 function openWindow(parent, url, features, arg)
--- a/suite/common/utilityOverlay.js
+++ b/suite/common/utilityOverlay.js
@@ -137,24 +137,28 @@ function setProxyTypeUI()
   var onlineTooltip = "onlineTooltip" + GetIntPref("network.proxy.type", 0);
   panel.setAttribute("tooltiptext", gUtilityBundle.getString(onlineTooltip));
 }
 
 function SetStringPref(aPref, aValue)
 {
   const nsISupportsString = Components.interfaces.nsISupportsString;
   try {
-    Services.prefs.setStringPref(aPref, aValue);
+    var str = Components.classes["@mozilla.org/supports-string;1"]
+                        .createInstance(nsISupportsString);
+    str.data = aValue;
+    Services.prefs.setComplexValue(aPref, nsISupportsString, str);
   } catch (e) {}
 }
 
 function GetStringPref(name)
 {
   try {
-    return Services.prefs.getStringPref(name);
+    return Services.prefs.getComplexValue(name,
+               Components.interfaces.nsISupportsString).data;
   } catch (e) {}
   return "";
 }
 
 function GetLocalizedStringPref(aPrefName, aDefaultValue)
 {
   try {
     return Services.prefs.getComplexValue(aPrefName,
--- a/suite/feeds/src/FeedWriter.js
+++ b/suite/feeds/src/FeedWriter.js
@@ -760,17 +760,18 @@ FeedWriter.prototype = {
   },
 
   _setSelectedHandler: function setSelectedHandler(feedType) {
     var handler = safeGetCharPref(getPrefReaderForType(feedType), "messenger");
 
     switch (handler) {
       case "web":
         if (this._handlersMenuList) {
-          var url = Services.prefs.getStringPref(getPrefWebForType(feedType));
+          var url = Services.prefs.getComplexValue(getPrefWebForType(feedType),
+                                                   Components.interfaces.nsISupportsString).data;
           var handlers = this._handlersMenuList.getElementsByAttribute("webhandlerurl", url);
           if (handlers.length == 0) {
             LOG("FeedWriter._setSelectedHandler: selected web handler isn't in the menulist");
             return;
           }
 
           handlers[0].doCommand();
         }
@@ -1113,17 +1114,21 @@ FeedWriter.prototype = {
 
       selectedItem = this._getSelectedItemFromMenulist(this._handlersMenuList);
     }
 
     if (selectedItem.hasAttribute("webhandlerurl")) {
       var webURI = selectedItem.getAttribute("webhandlerurl");
       Services.prefs.setCharPref(getPrefReaderForType(feedType), "web");
 
-      Services.prefs.setStringPref(getPrefWebForType(feedType), webURI);
+      var supportsString = Components.classes["@mozilla.org/supports-string;1"]
+                                     .createInstance(Components.interfaces.nsISupportsString);
+      supportsString.data = webURI;
+      Services.prefs.setComplexValue(getPrefWebForType(feedType), Components.interfaces.nsISupportsString,
+                                     supportsString);
 
       var wccr = Components.classes["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"]
                            .getService(Components.interfaces.nsIWebContentConverterService);
       var handler = wccr.getWebContentHandlerByURI(this._getMimeTypeForFeedType(feedType), webURI);
       if (handler) {
         if (useAsDefault)
           wccr.setAutoHandler(this._getMimeTypeForFeedType(feedType), handler);
 
--- a/suite/feeds/src/WebContentConverter.js
+++ b/suite/feeds/src/WebContentConverter.js
@@ -636,17 +636,21 @@ WebContentConverterRegistrar.prototype =
     this._updateContentTypeHandlerMap(contentType, uri, title);
     this._saveContentHandlerToPrefs(contentType, uri, title);
 
     if (contentType == TYPE_MAYBE_FEED) {
       // Make the new handler the last-selected reader in the preview page
       // and make sure the preview page is shown the next time a feed is visited
       Services.prefs.setCharPref(PREF_SELECTED_READER, "web");
 
-      Services.prefs.setStringPref(PREF_SELECTED_WEB, uri);
+      var supportsString = Components.classes["@mozilla.org/supports-string;1"]
+                                     .createInstance(Components.interfaces.nsISupportsString);
+      supportsString.data = uri;
+      Services.prefs.setComplexValue(PREF_SELECTED_WEB, Components.interfaces.nsISupportsString,
+                                     supportsString);
       Services.prefs.setCharPref(PREF_SELECTED_ACTION, "ask");
       this._setAutoHandler(TYPE_MAYBE_FEED, null);
     }
   },
 
   /**
    * Update the content type -> handler map. This mapping is not persisted, use
    * registerContentHandler or _saveContentHandlerToPrefs for that purpose.
--- a/suite/modules/test/unit/test_browser_sanitizer.js
+++ b/suite/modules/test/unit/test_browser_sanitizer.js
@@ -119,23 +119,27 @@ var sanTests = {
                                    .openDatabase(file);
         connection.createTable("urlbarhistory", "url TEXT");
         connection.executeSimpleSQL(
           "INSERT INTO urlbarhistory (url) VALUES ('Sanitizer')");
         connection.close();
       }
 
       // Open location dialog.
-      Services.prefs.setStringPref("general.open_location.last_url", "Sanitizer!");
+      var supStr = Components.classes["@mozilla.org/supports-string;1"]
+                             .createInstance(Components.interfaces.nsISupportsString);
+      supStr.data = "Sanitizer!";
+      Services.prefs.setComplexValue("general.open_location.last_url",
+                                      Components.interfaces.nsISupportsString, supStr);
     },
 
     check: function(aShouldBeCleared) {
       let locData;
       try {
-        locData = Services.prefs.getStringPref("general.open_location.last_url");
+        locData = Services.prefs.getComplexValue("general.open_location.last_url", Components.interfaces.nsISupportsString).data;
       } catch(ex) {}
 
       do_check_eq(locData == "Sanitizer!", !aShouldBeCleared);
 
       var file = Components.classes["@mozilla.org/file/directory_service;1"]
                            .getService(Components.interfaces.nsIProperties)
                            .get("ProfD", Components.interfaces.nsIFile);
       file.append("urlbarhistory.sqlite");