mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1156099 - Mark the atom members of NodeInfo as nsCOMPtr's; r=baku
Turns out I was wrong, and they are really owning references.
This commit is contained in:
parent
aa02c53f71
commit
2616c54a39
@ -37,10 +37,6 @@ using mozilla::dom::NodeInfo;
|
||||
NodeInfo::~NodeInfo()
|
||||
{
|
||||
mOwnerManager->RemoveNodeInfo(this);
|
||||
|
||||
NS_RELEASE(mInner.mName);
|
||||
NS_IF_RELEASE(mInner.mPrefix);
|
||||
NS_IF_RELEASE(mInner.mExtraName);
|
||||
}
|
||||
|
||||
NodeInfo::NodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
|
||||
@ -51,12 +47,12 @@ NodeInfo::NodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
|
||||
MOZ_ASSERT(aOwnerManager, "Invalid aOwnerManager");
|
||||
|
||||
// Initialize mInner
|
||||
NS_ADDREF(mInner.mName = aName);
|
||||
NS_IF_ADDREF(mInner.mPrefix = aPrefix);
|
||||
mInner.mName = aName;
|
||||
mInner.mPrefix = aPrefix;
|
||||
mInner.mNamespaceID = aNamespaceID;
|
||||
mInner.mNodeType = aNodeType;
|
||||
mOwnerManager = aOwnerManager;
|
||||
NS_IF_ADDREF(mInner.mExtraName = aExtraName);
|
||||
mInner.mExtraName = aExtraName;
|
||||
|
||||
mDocument = aOwnerManager->GetDocument();
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
#include "mozilla/dom/NameSpaceConstants.h"
|
||||
#include "nsStringGlue.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIAtom.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsIDocument;
|
||||
class nsNodeInfoManager;
|
||||
|
||||
@ -263,14 +263,12 @@ protected:
|
||||
{
|
||||
}
|
||||
|
||||
// These atoms hold pointers to nsGkAtoms members, and are therefore safe
|
||||
// as a non-owning reference.
|
||||
nsIAtom* MOZ_NON_OWNING_REF mName;
|
||||
nsIAtom* MOZ_NON_OWNING_REF mPrefix;
|
||||
nsCOMPtr<nsIAtom> mName;
|
||||
nsCOMPtr<nsIAtom> mPrefix;
|
||||
int32_t mNamespaceID;
|
||||
uint16_t mNodeType; // As defined by nsIDOMNode.nodeType
|
||||
const nsAString* mNameString;
|
||||
nsIAtom* MOZ_NON_OWNING_REF mExtraName; // Only used by PIs and DocTypes
|
||||
nsCOMPtr<nsIAtom> mExtraName; // Only used by PIs and DocTypes
|
||||
};
|
||||
|
||||
// nsNodeInfoManager needs to pass mInner to the hash table.
|
||||
|
Loading…
x
Reference in New Issue
Block a user