Bug 1374847 - Remove nsIPrefBranch2 and nsIPrefBranchInternal. r=njn

MozReview-Commit-ID: 2LFhKNVspko

--HG--
extra : rebase_source : 1acfd1427a2d81294d6cbc6358b1d1070b4c2c12
This commit is contained in:
Masatoshi Kimura 2017-08-04 17:12:58 +09:00
parent a791c795cb
commit b186427ed3
18 changed files with 13 additions and 55 deletions

View File

@ -28,7 +28,7 @@ XPCOMUtils.defineLazyGetter(this, "DevToolsShim", function () {
function setDefaultPrefs(prefsURI) {
const prefs = Cc['@mozilla.org/preferences-service;1'].
getService(Ci.nsIPrefService).
QueryInterface(Ci.nsIPrefBranch2);
QueryInterface(Ci.nsIPrefBranch);
const branch = prefs.getDefaultBranch('');
const sandbox = Sandbox({
name: prefsURI,

View File

@ -26,7 +26,7 @@ const PrefsTarget = Class({
let branch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService).
getBranch(branchName).
QueryInterface(Ci.nsIPrefBranch2);
QueryInterface(Ci.nsIPrefBranch);
prefTargetNS(this).branch = branch;
// provides easy access to preference values

View File

@ -5,7 +5,7 @@
var prefBranch = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
.QueryInterface(Ci.nsIPrefBranch);
const TEST_URI = "data:text/html;charset=utf-8,gcli-pref1";

View File

@ -5,7 +5,7 @@
var prefBranch = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
.QueryInterface(Ci.nsIPrefBranch);
const TEST_URI = "data:text/html;charset=utf-8,gcli-pref2";

View File

@ -5,7 +5,7 @@
var prefBranch = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
.QueryInterface(Ci.nsIPrefBranch);
var supportsString = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);

View File

@ -5,7 +5,7 @@
var prefBranch = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
.QueryInterface(Ci.nsIPrefBranch);
var supportsString = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);

View File

@ -20,7 +20,7 @@ const { PluralForm } = require("devtools/shared/plural-form");
loader.lazyGetter(this, "prefBranch", function () {
return Services.prefs.getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
.QueryInterface(Ci.nsIPrefBranch);
});
loader.lazyRequireGetter(this, "gcliInit", "devtools/shared/gcli/commands/index");

View File

@ -14,7 +14,7 @@ const l10n = require("gcli/l10n");
loader.lazyGetter(this, "prefBranch", function () {
let prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
return prefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
return prefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
});
loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");

View File

@ -22,7 +22,7 @@ var Ci = require('chrome').Ci;
var prefSvc = Cc['@mozilla.org/preferences-service;1']
.getService(Ci.nsIPrefService);
var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
exports.hiddenByChromePref = function() {
return !prefBranch.prefHasUserValue('devtools.chrome.enabled');

View File

@ -28,7 +28,7 @@ var Services = require("Services");
XPCOMUtils.defineLazyGetter(imports, 'prefBranch', function() {
var prefService = Cc['@mozilla.org/preferences-service;1']
.getService(Ci.nsIPrefService);
return prefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
return prefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
});
XPCOMUtils.defineLazyGetter(imports, 'supportsString', function() {

View File

@ -719,8 +719,6 @@ NS_INTERFACE_MAP_BEGIN(Preferences)
NS_INTERFACE_MAP_ENTRY(nsIPrefService)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsIPrefBranch)
NS_INTERFACE_MAP_ENTRY(nsIPrefBranch2)
NS_INTERFACE_MAP_ENTRY(nsIPrefBranchInternal)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END

View File

@ -12,7 +12,6 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranchInternal.h"
#include "nsIObserver.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
@ -49,7 +48,7 @@ class PrefSetting;
class Preferences final : public nsIPrefService,
public nsIObserver,
public nsIPrefBranchInternal,
public nsIPrefBranch,
public nsSupportsWeakReference
{
public:

View File

@ -17,8 +17,6 @@ XPCSHELL_TESTS_MANIFESTS += [
XPIDL_SOURCES += [
'nsIPrefBranch.idl',
'nsIPrefBranch2.idl',
'nsIPrefBranchInternal.idl',
'nsIPrefLocalizedString.idl',
'nsIPrefService.idl',
'nsIRelativeFilePref.idl',

View File

@ -1,16 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIPrefBranch.idl"
/**
* An empty interface to provide backwards compatibility for existing code.
*
* @see nsIPrefBranch
*/
[scriptable, uuid(8892016d-07f7-4530-b5c1-d73dfcde4a1c)]
interface nsIPrefBranch2 : nsIPrefBranch
{
};

View File

@ -1,17 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIPrefBranch2.idl"
/**
* An empty interface to provide backwards compatibility for existing code that
* bsmedberg didn't want to break all at once. Don't use me!
*
* @status NON-FROZEN interface WHICH WILL PROBABLY GO AWAY.
*/
[scriptable, uuid(355bd1e9-248a-438b-809d-e0db1b287882)]
interface nsIPrefBranchInternal : nsIPrefBranch2
{
};

View File

@ -103,8 +103,6 @@ NS_IMPL_RELEASE(nsPrefBranch)
NS_INTERFACE_MAP_BEGIN(nsPrefBranch)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrefBranch)
NS_INTERFACE_MAP_ENTRY(nsIPrefBranch)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIPrefBranch2, !mIsDefault)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIPrefBranchInternal, !mIsDefault)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END

View File

@ -9,7 +9,6 @@
#include "nsCOMPtr.h"
#include "nsIObserver.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranchInternal.h"
#include "nsIPrefLocalizedString.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
@ -176,7 +175,7 @@ class PrefCallback : public PLDHashEntryHdr {
}
};
class nsPrefBranch final : public nsIPrefBranchInternal,
class nsPrefBranch final : public nsIPrefBranch,
public nsIObserver,
public nsSupportsWeakReference
{
@ -184,7 +183,6 @@ class nsPrefBranch final : public nsIPrefBranchInternal,
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPREFBRANCH
NS_DECL_NSIPREFBRANCH2
NS_DECL_NSIOBSERVER
nsPrefBranch(const char *aPrefRoot, bool aDefaultBranch);

View File

@ -94,7 +94,7 @@
</field>
<field name="rootBranchInternal">
Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranchInternal);
.getService(Components.interfaces.nsIPrefBranch);
</field>
<property name="type" readonly="true">
<getter>