Bug 718255 - Merge nsIPrefBranch2 with nsIPrefBranch - Part B, remove uses of nsIPrefBranch2 in modules/libpref/ ; r=bsmedberg

This commit is contained in:
Geoff Lankow 2012-01-16 21:47:13 +13:00
parent 909101e444
commit baa4881110
7 changed files with 6 additions and 16 deletions

View File

@ -67,7 +67,7 @@ nsDSURIContentListener::nsDSURIContentListener(nsDocShell* aDocShell)
// Set up a pref cache for sIgnoreXFrameOptions, if we haven't already.
if (NS_UNLIKELY(!initializedPrefCache)) {
// Lock the pref so that the user's changes to it, if any, are ignored.
nsIPrefBranch2 *root = Preferences::GetRootBranch();
nsIPrefBranch *root = Preferences::GetRootBranch();
root->LockPref("b2g.ignoreXFrameOptions");
Preferences::AddBoolVarCache(&sIgnoreXFrameOptions, "b2g.ignoreXFrameOptions");

View File

@ -73,7 +73,6 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPREFSERVICE
NS_FORWARD_NSIPREFBRANCH(sRootBranch->)
NS_FORWARD_NSIPREFBRANCH2(sRootBranch->)
NS_DECL_NSIOBSERVER
Preferences();
@ -110,7 +109,7 @@ public:
* Returns shared pref branch instance.
* NOTE: not addreffed.
*/
static nsIPrefBranch2* GetRootBranch()
static nsIPrefBranch* GetRootBranch()
{
NS_ENSURE_TRUE(InitStaticMembers(), nsnull);
return sRootBranch;
@ -365,8 +364,7 @@ private:
nsCOMPtr<nsIFile> mCurrentFile;
static Preferences* sPreferences;
static nsIPrefBranch2* sRootBranch;
// NOTE: default branch doesn't return nsIPrefBranch2 interface at query.
static nsIPrefBranch* sRootBranch;
static nsIPrefBranch* sDefaultRootBranch;
static bool sShutdown;

View File

@ -90,7 +90,7 @@ static nsresult pref_LoadPrefsInDirList(const char *listId);
static nsresult ReadExtensionPrefs(nsIFile *aFile);
Preferences* Preferences::sPreferences = nsnull;
nsIPrefBranch2* Preferences::sRootBranch = nsnull;
nsIPrefBranch* Preferences::sRootBranch = nsnull;
nsIPrefBranch* Preferences::sDefaultRootBranch = nsnull;
bool Preferences::sShutdown = false;

View File

@ -561,11 +561,6 @@ NS_IMETHODIMP nsPrefBranch::GetChildList(const char *aStartingAt, PRUint32 *aCou
return NS_OK;
}
/*
* nsIPrefBranch2 methods
*/
NS_IMETHODIMP nsPrefBranch::AddObserver(const char *aDomain, nsIObserver *aObserver, bool aHoldWeak)
{
PrefCallback *pCallback;

View File

@ -9,7 +9,7 @@ function run_test() {
const PREF_NAME = "testPref";
var prefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefBranch2);
.getService(Ci.nsIPrefBranch);
var observer = {
QueryInterface: function QueryInterface(aIID) {
if (aIID.equals(Ci.nsIObserver) ||

View File

@ -38,9 +38,6 @@ function run_test() {
var ps = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
var pb2= Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
var pb = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);

View File

@ -55,7 +55,7 @@ function run_test() {
getService(Ci.nsIPrefService);
var pb2= Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
getService(Ci.nsIPrefBranch);
var pb = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);