Bug 1257128 (part 1) - Remove nsIAtom.equalsUTF8. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 16 Mar 2016 21:05:30 +1100
changeset 290182 0eba208813c315fac76f9825cb1385c7432c1f44
parent 290181 c617aafb0e961fb863d3a5222dbca082a6a9c3b5
child 290183 1eee02156b68f5171ef8d087ed5bb614339b053a
push id30114
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 15:15:54 +0000
treeherdermozilla-central@24c5fbde4488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1257128
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257128 (part 1) - Remove nsIAtom.equalsUTF8. r=froydnj. It's only used in tests.
parser/html/nsHtml5Atom.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsIAtom.idl
xpcom/tests/gtest/TestAtoms.cpp
--- a/parser/html/nsHtml5Atom.cpp
+++ b/parser/html/nsHtml5Atom.cpp
@@ -75,15 +75,8 @@ nsHtml5Atom::IsStaticAtom()
 }
 
 NS_IMETHODIMP
 nsHtml5Atom::ScriptableEquals(const nsAString& aString, bool* aResult)
 {
   NS_NOTREACHED("Should not call ScriptableEquals.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
-
-NS_IMETHODIMP_(bool)
-nsHtml5Atom::EqualsUTF8(const nsACString& aString)
-{
-  NS_NOTREACHED("Should not attempt to compare with an UTF-8 string.");
-  return false;
-}
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -459,23 +459,16 @@ AtomImpl::ScriptableToString(nsAString& 
 
 NS_IMETHODIMP
 AtomImpl::ToUTF8String(nsACString& aBuf)
 {
   CopyUTF16toUTF8(nsDependentString(mString, mLength), aBuf);
   return NS_OK;
 }
 
-NS_IMETHODIMP_(bool)
-AtomImpl::EqualsUTF8(const nsACString& aString)
-{
-  return CompareUTF8toUTF16(aString,
-                            nsDependentString(mString, mLength)) == 0;
-}
-
 NS_IMETHODIMP
 AtomImpl::ScriptableEquals(const nsAString& aString, bool* aResult)
 {
   *aResult = aString.Equals(nsDependentString(mString, mLength));
   return NS_OK;
 }
 
 NS_IMETHODIMP_(bool)
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -25,18 +25,16 @@ interface nsIAtom : nsISupports
   [binaryname(ScriptableToString)] AString toString(); 
   [noscript] AUTF8String toUTF8String();
   
   /**
    * Compare the atom to a specific string value
    * Note that this will NEVER return/throw an error condition.
    */
   [binaryname(ScriptableEquals)] boolean equals(in AString aString);
-  
-  [noscript, notxpcom] boolean equalsUTF8(in AUTF8String aString);
 
   /**
    * Returns true if the atom is static and false otherwise.
    */
   [noscript, notxpcom] boolean isStaticAtom();
 
 %{C++
   // note this is NOT virtual so this won't muck with the vtable!
--- a/xpcom/tests/gtest/TestAtoms.cpp
+++ b/xpcom/tests/gtest/TestAtoms.cpp
@@ -21,17 +21,16 @@ TEST(Atoms, Basic)
 {
   for (unsigned int i = 0; i < ArrayLength(ValidStrings); ++i) {
     nsDependentString str16(ValidStrings[i].m16);
     nsDependentCString str8(ValidStrings[i].m8);
 
     nsCOMPtr<nsIAtom> atom = do_GetAtom(str16);
 
     EXPECT_TRUE(atom->Equals(str16));
-    EXPECT_TRUE(atom->EqualsUTF8(str8));
 
     nsString tmp16;
     nsCString tmp8;
     atom->ToString(tmp16);
     atom->ToUTF8String(tmp8);
     EXPECT_TRUE(str16.Equals(tmp16));
     EXPECT_TRUE(str8.Equals(tmp8));
 
@@ -69,17 +68,16 @@ TEST(Atoms, NUll)
 
   EXPECT_FALSE(str.Equals(strCut));
 
   nsCOMPtr<nsIAtom> atomCut = do_GetAtom(strCut);
   nsCOMPtr<nsIAtom> atom = do_GetAtom(str);
 
   EXPECT_EQ(atom->GetLength(), str.Length());
   EXPECT_TRUE(atom->Equals(str));
-  EXPECT_TRUE(atom->EqualsUTF8(NS_ConvertUTF16toUTF8(str)));
   EXPECT_NE(atom, atomCut);
   EXPECT_TRUE(atomCut->Equals(strCut));
 }
 
 TEST(Atoms, Invalid)
 {
   for (unsigned int i = 0; i < ArrayLength(Invalid16Strings); ++i) {
     nsrefcnt count = NS_GetNumberOfAtoms();