Bug 1345804 part 1 - Constify several stuff in nsIAtom. r?erahm draft
authorXidorn Quan <me@upsuper.org>
Fri, 10 Mar 2017 11:38:49 +1100
changeset 496220 6afe6d51f7dfe1bd9b86334c1b2aa6b67c804ba8
parent 496219 b6466bb717aca631d9712fc7f2d98de023ccef9e
child 496221 41c2c1ef9a62f7621807888d7a4e6d47b4007302
child 496315 729970c20c1e5fc6e8b75b78ac4b4910d9462fbf
child 496413 658968abf2689291da96fcff52b2bc47e15dc16b
child 496438 f590b96673861157306dfa6d612aecbf24fce5a6
push id48562
push userxquan@mozilla.com
push dateFri, 10 Mar 2017 00:42:06 +0000
reviewerserahm
bugs1345804
milestone55.0a1
Bug 1345804 part 1 - Constify several stuff in nsIAtom. r?erahm MozReview-Commit-ID: Izzu0MpcKMr
xpcom/ds/nsIAtom.idl
--- 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())
   {
   }
 };
 
 %}