Bug 1491574 - Part 2: Remove the XPCOM registration for nsPersistentProperties; r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D5950
This commit is contained in:
Ehsan Akhgari 2018-09-15 12:58:31 -04:00
Родитель 9aa38967b7
Коммит 5d9d4af0cd
15 изменённых файлов: 30 добавлений и 54 удалений

Просмотреть файл

@ -65,6 +65,7 @@
#include "nsIServiceManager.h"
#include "nsWhitespaceTokenizer.h"
#include "nsAttrName.h"
#include "nsPersistentProperties.h"
#include "mozilla/Assertions.h"
#include "mozilla/BasicEvents.h"
@ -1019,8 +1020,7 @@ Accessible::Attributes()
already_AddRefed<nsIPersistentProperties>
Accessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
nsAutoString unused;

Просмотреть файл

@ -25,7 +25,7 @@
#include "nsFrameSelection.h"
#include "nsILineIterator.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIPersistentProperties2.h"
#include "nsPersistentProperties.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsITextControlElement.h"
@ -880,8 +880,7 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
return nullptr;
}
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
Accessible* accAtOffset = GetChildAtOffset(offset);
if (!accAtOffset) {
@ -925,8 +924,7 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
already_AddRefed<nsIPersistentProperties>
HyperTextAccessible::DefaultTextAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
TextAttrsMgr textAttrsMgr(this);
textAttrsMgr.GetAttributes(attributes);

Просмотреть файл

@ -11,7 +11,7 @@
#include "IUnknownImpl.h"
#include "nsIGfxInfo.h"
#include "nsIPersistentProperties2.h"
#include "nsPersistentProperties.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/Services.h"
@ -26,8 +26,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessibleWrap,
already_AddRefed<nsIPersistentProperties>
ApplicationAccessibleWrap::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
if (gfxInfo) {

Просмотреть файл

@ -16,7 +16,7 @@
#include "xpcAccessibleDocument.h"
#include "nsIMutableArray.h"
#include "nsIPersistentProperties2.h"
#include "nsPersistentProperties.h"
using namespace mozilla::a11y;
@ -416,8 +416,7 @@ xpcAccessible::GetAttributes(nsIPersistentProperties** aAttributes)
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
nsCOMPtr<nsIPersistentProperties> props =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> props = new nsPersistentProperties();
uint32_t attrCount = attrs.Length();
nsAutoString unused;
for (uint32_t i = 0; i < attrCount; i++) {

Просмотреть файл

@ -18,7 +18,7 @@
#include "nsIBoxObject.h"
#include "nsIMutableArray.h"
#include "nsIPersistentProperties2.h"
#include "nsPersistentProperties.h"
#include "nsITreeSelection.h"
#include "nsComponentManagerUtils.h"
#include "mozilla/dom/Element.h"
@ -646,8 +646,7 @@ XULTreeGridCellAccessible::Selected()
already_AddRefed<nsIPersistentProperties>
XULTreeGridCellAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
// "table-cell-index" attribute
TableAccessible* table = Table();

Просмотреть файл

@ -17,6 +17,7 @@ interface nsICycleCollectorListener;
interface nsIEditorSpellCheck;
interface nsIFile;
interface nsILoadContext;
interface nsIPersistentProperties;
interface nsIURI;
interface nsIJSCID;
interface nsIJSIID;
@ -731,6 +732,9 @@ interface nsIXPCComponents_Utils : nsISupports
/* Create a private loadcontext object. */
nsILoadContext createPrivateLoadContext();
/* Create a persistent property object. */
nsIPersistentProperties createPersistentProperties();
};
/**

Просмотреть файл

@ -44,7 +44,7 @@
#include "GeckoProfiler.h"
#include "mozilla/EditorSpellCheck.h"
#include "nsCommandLine.h"
#include "nsCommandParams.h"
#include "nsPersistentProperties.h"
using namespace mozilla;
using namespace JS;
@ -3251,6 +3251,15 @@ nsXPCComponents_Utils::CreatePrivateLoadContext(nsILoadContext** aLoadContext)
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::CreatePersistentProperties(nsIPersistentProperties** aPersistentProperties)
{
NS_ENSURE_ARG_POINTER(aPersistentProperties);
nsCOMPtr<nsIPersistentProperties> props = new nsPersistentProperties();
props.forget(aPersistentProperties);
return NS_OK;
}
/***************************************************************************/
/***************************************************************************/
/***************************************************************************/

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsINode.h"
#include "nsIObjectLoadingContent.h"
#include "nsIOfflineCacheUpdate.h"
#include "nsIPersistentProperties2.h"
#include "nsPersistentProperties.h"
#include "nsIPrivateBrowsingChannel.h"
#include "nsIPropertyBag2.h"
#include "nsIProtocolProxyService.h"
@ -2029,9 +2029,7 @@ NS_LoadPersistentPropertiesFromURISpec(nsIPersistentProperties **outResult,
rv = channel->Open2(getter_AddRefs(in));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIPersistentProperties> properties =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIPersistentProperties> properties = new nsPersistentProperties();
rv = properties->Load(in);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -28,7 +28,6 @@
#include "nsCycleCollector.h"
#include "nsObserverList.h"
#include "nsObserverService.h"
#include "nsPersistentProperties.h"
#include "nsScriptableInputStream.h"
#include "nsBinaryStream.h"
#include "nsStorageStream.h"
@ -256,8 +255,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsChromeRegistry,
nsChromeRegistry::GetSingleton)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsChromeProtocolHandler)
#define NS_PERSISTENTPROPERTIES_CID NS_IPERSISTENTPROPERTIES_CID /* sigh */
static already_AddRefed<nsIFactory>
CreateINIParserFactory(const mozilla::Module& aModule,
const mozilla::Module::CIDEntry& aEntry)

Просмотреть файл

@ -12,8 +12,6 @@
COMPONENT(SCRIPTABLEBASE64ENCODER, nsScriptableBase64EncoderConstructor)
COMPONENT(PIPE, nsPipeConstructor)
COMPONENT(PERSISTENTPROPERTIES, nsPersistentProperties::Create)
COMPONENT(ARRAY, nsArrayBase::XPCOMConstructor)
COMPONENT(CONSOLESERVICE, nsConsoleServiceConstructor)
COMPONENT_M(OBSERVERSERVICE, nsObserverService::Create, Module::ALLOW_IN_GPU_PROCESS)

Просмотреть файл

@ -61,6 +61,7 @@ EXPORTS += [
'nsInterfaceHashtable.h',
'nsJSThingHashtable.h',
'nsMathUtils.h',
'nsPersistentProperties.h',
'nsPointerHashKeys.h',
'nsProperties.h',
'nsQuickSort.h',

Просмотреть файл

@ -58,13 +58,3 @@ interface nsIPersistentProperties : nsIProperties
%}
};
%{C++
#define NS_IPERSISTENTPROPERTIES_CID \
{ 0x2245e573, 0x9464, 0x11d2, \
{ 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
#define NS_PERSISTENTPROPERTIES_CONTRACTID "@mozilla.org/persistent-properties;1"
%}

Просмотреть файл

@ -459,17 +459,6 @@ nsPersistentProperties::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
return aMallocSizeOf(this) + n;
}
nsresult
nsPersistentProperties::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult)
{
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsPersistentProperties> props = new nsPersistentProperties();
return props->QueryInterface(aIID, aResult);
}
NS_IMPL_ISUPPORTS(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
NS_IMETHODIMP

Просмотреть файл

@ -25,9 +25,6 @@ public:
NS_DECL_NSIPROPERTIES
NS_DECL_NSIPERSISTENTPROPERTIES
static MOZ_MUST_USE nsresult
Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
private:

Просмотреть файл

@ -9,8 +9,7 @@ function run_test() {
});
var inp = channel.open2();
var properties = Cc["@mozilla.org/persistent-properties;1"].
createInstance(Ci.nsIPersistentProperties);
var properties = Cu.createPersistentProperties();
properties.load(inp);
var value;
@ -56,8 +55,7 @@ function run_test() {
});
inp = channel2.open2();
var properties2 = Cc["@mozilla.org/persistent-properties;1"].
createInstance(Ci.nsIPersistentProperties);
var properties2 = Cu.createPersistentProperties();
try {
properties2.load(inp);
do_throw("load() didn't fail");