Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 718255 - Merge nsIPrefBranch2 with nsIPrefBranch - Part G, remove…

… remaining uses of nsIPrefBranch2; r=bsmedberg
  • Loading branch information...
commit a2073af970020c49f19111c2757e782133b77a70 1 parent dcf65c7
@darktrojan darktrojan authored
Showing with 33 additions and 46 deletions.
  1. +6 −9 chrome/src/nsChromeRegistryChrome.cpp
  2. +0 −1  content/base/src/CSPUtils.jsm
  3. +2 −2 content/events/test/test_bug350471.xul
  4. +2 −2 content/events/test/test_bug607464.html
  5. +1 −1  content/events/test/test_clickevent_on_input.html
  6. +3 −4 dom/ipc/ContentParent.cpp
  7. +1 −1  dom/plugins/base/nsPluginHost.cpp
  8. +1 −1  dom/src/geolocation/nsGeolocation.cpp
  9. +1 −2  extensions/cookie/nsCookiePermission.cpp
  10. +1 −2  extensions/cookie/nsPopupWindowManager.cpp
  11. +2 −2 extensions/gio/nsGIOProtocolHandler.cpp
  12. +2 −2 extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
  13. +2 −2 extensions/permissions/nsContentBlocker.h
  14. +0 −1  extensions/spellcheck/src/mozPersonalDictionary.cpp
  15. +2 −5 security/manager/ssl/src/nsNSSComponent.cpp
  16. +1 −1  security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing.html
  17. +0 −1  services/crypto/modules/WeaveCrypto.js
  18. +2 −2 services/sync/modules/engines/prefs.js
  19. +1 −2  services/sync/modules/ext/Preferences.js
  20. +1 −1  services/sync/tests/unit/test_Preferences.js
  21. +1 −1  widget/tests/window_bug478536.xul
  22. +1 −1  widget/tests/window_wheeltransaction.xul
View
15 chrome/src/nsChromeRegistryChrome.cpp
@@ -67,7 +67,7 @@
#include "nsILocaleService.h"
#include "nsILocalFile.h"
#include "nsIObserverService.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsIResProtocolHandler.h"
#include "nsIScriptError.h"
@@ -190,12 +190,9 @@ nsChromeRegistryChrome::Init()
SelectLocaleFromPref(prefs);
- nsCOMPtr<nsIPrefBranch2> prefs2 (do_QueryInterface(prefs));
- if (prefs2) {
- rv = prefs2->AddObserver(MATCH_OS_LOCALE_PREF, this, true);
- rv = prefs2->AddObserver(SELECTED_LOCALE_PREF, this, true);
- rv = prefs2->AddObserver(SELECTED_SKIN_PREF, this, true);
- }
+ rv = prefs->AddObserver(MATCH_OS_LOCALE_PREF, this, true);
+ rv = prefs->AddObserver(SELECTED_LOCALE_PREF, this, true);
+ rv = prefs->AddObserver(SELECTED_SKIN_PREF, this, true);
}
nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
@@ -220,7 +217,7 @@ nsChromeRegistryChrome::CheckForOSAccessibility()
RefreshSkins();
}
- nsCOMPtr<nsIPrefBranch2> prefs (do_GetService(NS_PREFSERVICE_CONTRACTID));
+ nsCOMPtr<nsIPrefBranch> prefs (do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->RemoveObserver(SELECTED_SKIN_PREF, this);
}
@@ -387,7 +384,7 @@ nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
false, uiLocale);
if (NS_SUCCEEDED(rv) && !uiLocale.IsEmpty()) {
CopyUTF16toUTF8(uiLocale, mSelectedLocale);
- nsCOMPtr<nsIPrefBranch2> prefs (do_GetService(NS_PREFSERVICE_CONTRACTID));
+ nsCOMPtr<nsIPrefBranch> prefs (do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->RemoveObserver(SELECTED_LOCALE_PREF, this);
}
View
1  content/base/src/CSPUtils.jsm
@@ -64,7 +64,6 @@ var gPrefObserver = {
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
this._branch = prefSvc.getBranch("security.csp.");
- this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
this._branch.addObserver("", this, false);
this._debugEnabled = this._branch.getBoolPref("debug");
},
View
4 content/events/test/test_bug350471.xul
@@ -222,7 +222,7 @@ function initPrefs()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
// Disables the app level scroll acceleration
prefSvc.setIntPref("mousewheel.acceleration.start", -1);
prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
@@ -233,7 +233,7 @@ function clearPrefs()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
prefSvc.clearUserPref("mousewheel.acceleration.start");
prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
View
4 content/events/test/test_bug607464.html
@@ -70,7 +70,7 @@
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
// Disables the app level scroll acceleration
prefSvc.setIntPref("mousewheel.acceleration.start", -1);
prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
@@ -83,7 +83,7 @@
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
if (prefSvc.prefHasUserValue("mousewheel.acceleration.start"))
prefSvc.clearUserPref("mousewheel.acceleration.start");
View
2  content/events/test/test_clickevent_on_input.html
@@ -45,7 +45,7 @@
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
try {
return prefs.getBoolPref("middlemouse.paste");
} catch (e) {
View
7 dom/ipc/ContentParent.cpp
@@ -50,7 +50,6 @@
#include "nsIWindowWatcher.h"
#include "nsIDOMWindow.h"
#include "nsIPrefBranch.h"
-#include "nsIPrefBranch2.h"
#include "nsIPrefLocalizedString.h"
#include "nsIObserverService.h"
#include "nsContentUtils.h"
@@ -218,7 +217,7 @@ ContentParent::Init()
obs->AddObserver(this, "a11y-init-or-shutdown", false);
#endif
}
- nsCOMPtr<nsIPrefBranch2> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
+ nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->AddObserver("", this, false);
}
@@ -331,7 +330,7 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
SetChildMemoryReporters(empty);
// remove the global remote preferences observers
- nsCOMPtr<nsIPrefBranch2> prefs
+ nsCOMPtr<nsIPrefBranch> prefs
(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->RemoveObserver("", this);
@@ -1117,7 +1116,7 @@ ContentParent::RecvLoadURIExternal(const IPC::URI& uri)
/* void onDispatchedEvent (in nsIThreadInternal thread); */
NS_IMETHODIMP
ContentParent::OnDispatchedEvent(nsIThreadInternal *thread)
-{
+{
NS_NOTREACHED("OnDispatchedEvent unimplemented");
return NS_ERROR_NOT_IMPLEMENTED;
}
View
2  dom/plugins/base/nsPluginHost.cpp
@@ -80,7 +80,7 @@
#include "nsHashtable.h"
#include "nsIProxyInfo.h"
#include "nsPluginLogging.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
#include "nsIScriptChannel.h"
#include "nsIBlocklistService.h"
#include "nsVersionComparator.h"
View
2  dom/src/geolocation/nsGeolocation.cpp
@@ -67,7 +67,7 @@
#include "nsIPermissionManager.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
#include "nsIJSContextStack.h"
#include "nsThreadUtils.h"
#include "mozilla/Services.h"
View
3  extensions/cookie/nsCookiePermission.cpp
@@ -51,7 +51,6 @@
#include "nsIURI.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#include "nsIPrefBranch2.h"
#include "nsIChannel.h"
#include "nsIHttpChannelInternal.h"
#include "nsIDOMWindow.h"
@@ -105,7 +104,7 @@ nsCookiePermission::Init()
if (NS_FAILED(rv)) return false;
// failure to access the pref service is non-fatal...
- nsCOMPtr<nsIPrefBranch2> prefBranch =
+ nsCOMPtr<nsIPrefBranch> prefBranch =
do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefBranch) {
prefBranch->AddObserver(kCookiesLifetimePolicy, this, false);
View
3  extensions/cookie/nsPopupWindowManager.cpp
@@ -41,7 +41,6 @@
#include "nsIServiceManager.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#include "nsIPrefBranch2.h"
/**
* The Popup Window Manager maintains popup window permissions by website.
@@ -73,7 +72,7 @@ nsPopupWindowManager::Init()
nsresult rv;
mPermissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
- nsCOMPtr<nsIPrefBranch2> prefBranch =
+ nsCOMPtr<nsIPrefBranch> prefBranch =
do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv)) {
bool permission;
View
4 extensions/gio/nsGIOProtocolHandler.cpp
@@ -43,7 +43,7 @@
*/
#include "mozilla/ModuleUtils.h"
#include "nsIPrefService.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
#include "nsIObserver.h"
#include "nsThreadUtils.h"
#include "nsProxyRelease.h"
@@ -944,7 +944,7 @@ nsGIOProtocolHandler::Init()
sGIOLog = PR_NewLogModule("gio");
#endif
- nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+ nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs)
{
InitSupportedProtocolsPref(prefs);
View
4 extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
@@ -47,7 +47,7 @@ extern "C" {
#include "mozilla/ModuleUtils.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIPrefService.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
#include "nsIObserver.h"
#include "nsThreadUtils.h"
#include "nsProxyRelease.h"
@@ -799,7 +799,7 @@ nsGnomeVFSProtocolHandler::Init()
}
}
- nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+ nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs)
{
InitSupportedProtocolsPref(prefs);
View
4 extensions/permissions/nsContentBlocker.h
@@ -40,7 +40,7 @@
#include "nsIObserver.h"
#include "nsWeakReference.h"
#include "nsIPermissionManager.h"
-#include "nsIPrefBranch2.h"
+#include "nsIPrefBranch.h"
class nsIPrefBranch;
@@ -71,7 +71,7 @@ class nsContentBlocker : public nsIContentPolicy,
bool *aFromPrefs);
nsCOMPtr<nsIPermissionManager> mPermissionManager;
- nsCOMPtr<nsIPrefBranch2> mPrefBranchInternal;
+ nsCOMPtr<nsIPrefBranch> mPrefBranchInternal;
static PRUint8 mBehaviorPref[];
};
View
1  extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -45,7 +45,6 @@
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#include "nsIPrefBranch2.h"
#include "nsIWeakReference.h"
#include "nsCRT.h"
#include "nsNetUtil.h"
View
7 security/manager/ssl/src/nsNSSComponent.cpp
@@ -67,7 +67,6 @@
#include "prlog.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#include "nsIPrefBranch2.h"
#include "nsIDateTimeFormat.h"
#include "nsDateTimeFormatCID.h"
#include "nsIDOMEvent.h"
@@ -1782,8 +1781,7 @@ nsNSSComponent::InitializeNSS(bool showWarningBox)
PK11_SetPasswordFunc(PK11PasswordPrompt);
// Register an observer so we can inform NSS when these prefs change
- nsCOMPtr<nsIPrefBranch2> pbi = do_QueryInterface(mPrefBranch);
- pbi->AddObserver("security.", this, false);
+ mPrefBranch->AddObserver("security.", this, false);
SSL_OptionSetDefault(SSL_ENABLE_SSL2, false);
SSL_OptionSetDefault(SSL_V2_COMPATIBLE_HELLO, false);
@@ -1907,8 +1905,7 @@ nsNSSComponent::ShutdownNSS()
UnregisterMyOCSPAIAInfoCallback();
if (mPrefBranch) {
- nsCOMPtr<nsIPrefBranch2> pbi = do_QueryInterface(mPrefBranch);
- pbi->RemoveObserver("security.", this);
+ mPrefBranch->RemoveObserver("security.", this);
}
ShutdownSmartCardThreads();
View
2  security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing.html
@@ -101,7 +101,7 @@
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
_PrefSvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
- .QueryInterface(Components.interfaces.nsIPrefBranch2);
+ .QueryInterface(Components.interfaces.nsIPrefBranch);
return _PrefSvc;
} catch (e) {}
return null;
View
1  services/crypto/modules/WeaveCrypto.js
@@ -88,7 +88,6 @@ WeaveCrypto.prototype = {
try {
// Preferences. Add observer so we get notified of changes.
this.prefBranch = Services.prefs.getBranch("services.sync.log.");
- this.prefBranch.QueryInterface(Ci.nsIPrefBranch2);
this.prefBranch.addObserver("cryptoDebug", this.observer, false);
this.observer._self = this;
this.debug = this.prefBranch.getBoolPref("cryptoDebug");
View
4 services/sync/modules/engines/prefs.js
@@ -257,7 +257,7 @@ PrefTracker.prototype = {
case "weave:engine:start-tracking":
if (!this._enabled) {
Cc["@mozilla.org/preferences-service;1"]
- .getService(Ci.nsIPrefBranch2).addObserver("", this, false);
+ .getService(Ci.nsIPrefBranch).addObserver("", this, false);
this._enabled = true;
}
break;
@@ -268,7 +268,7 @@ PrefTracker.prototype = {
case "profile-before-change":
this.__prefs = null;
Cc["@mozilla.org/preferences-service;1"]
- .getService(Ci.nsIPrefBranch2).removeObserver("", this);
+ .getService(Ci.nsIPrefBranch).removeObserver("", this);
break;
case "nsPref:changed":
// Trigger a sync for MULTI-DEVICE for a change that determines
View
3  services/sync/modules/ext/Preferences.js
@@ -436,8 +436,7 @@ Preferences.prototype = {
if (this._defaultBranch) {
prefSvc = prefSvc.getDefaultBranch(this._prefBranch);
} else {
- prefSvc = prefSvc.getBranch(this._prefBranch)
- .QueryInterface(Ci.nsIPrefBranch2);
+ prefSvc = prefSvc.getBranch(this._prefBranch);
}
this.__defineGetter__("_prefSvc", function() prefSvc);
View
2  services/sync/tests/unit/test_Preferences.js
@@ -195,7 +195,7 @@ function test_observe_prefs_nsIObserver() {
observed: false,
observe: function(subject, topic, data) {
this.observed = !this.observed;
- do_check_true(subject instanceof Ci.nsIPrefBranch2);
+ do_check_true(subject instanceof Ci.nsIPrefBranch);
do_check_eq(topic, "nsPref:changed");
do_check_eq(data, "test_observe_prefs_nsIObserver");
}
View
2  widget/tests/window_bug478536.xul
@@ -77,7 +77,7 @@ var gCurrentTestIndex = -1;
var gIgnoreScrollEvent = true;
var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
const kPrefSmoothScroll = "general.smoothScroll";
const kPrefNameTimeout = "mousewheel.transaction.timeout";
const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
View
2  widget/tests/window_wheeltransaction.xul
@@ -109,7 +109,7 @@ var gLitesnEvents = kListenEvent_None;
var gTimer;
var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch2);
+ getService(Components.interfaces.nsIPrefBranch);
const kPrefSmoothScroll = "general.smoothScroll";
const kPrefNameTimeout = "mousewheel.transaction.timeout";
const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
Please sign in to comment.
Something went wrong with that request. Please try again.