Bug 1345804 part 1 - Constify several stuff in nsIAtom. r?erahm
MozReview-Commit-ID: Izzu0MpcKMr
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -49,17 +49,17 @@ interface nsIAtom : nsISupports
inline char16ptr_t GetUTF16String() const {
return mString;
}
inline uint32_t GetLength() const {
return mLength;
}
- inline void ToString(nsAString& aBuf) {
+ inline void ToString(nsAString& aBuf) const {
// See the comment on |mString|'s declaration.
nsStringBuffer::FromData(mString)->ToString(mLength, aBuf);
}
inline nsStringBuffer* GetStringBuffer() const {
// See the comment on |mString|'s declaration.
return nsStringBuffer::FromData(mString);
}
@@ -134,17 +134,17 @@ extern nsIAtom* NS_GetStaticAtom(const n
/**
* Seal the static atom table
*/
extern void NS_SealStaticAtomTable();
class nsAtomString : public nsString
{
public:
- explicit nsAtomString(nsIAtom* aAtom)
+ explicit nsAtomString(const nsIAtom* aAtom)
{
aAtom->ToString(*this);
}
};
class nsAtomCString : public nsCString
{
public:
@@ -152,15 +152,15 @@ public:
{
aAtom->ToUTF8String(*this);
}
};
class nsDependentAtomString : public nsDependentString
{
public:
- explicit nsDependentAtomString(nsIAtom* aAtom)
+ explicit nsDependentAtomString(const nsIAtom* aAtom)
: nsDependentString(aAtom->GetUTF16String(), aAtom->GetLength())
{
}
};
%}