Bug 1416038 (part 10) - nsSAXXMLReader.cpp doesn't need to be an nsIExtendedExpatSink. r=erahm
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 14 Nov 2017 08:30:36 +1100
changeset 436148 ce6e3bf3c2dcb923a2f5ed88326a3a00c3358965
parent 436147 a6d60c62fa91a2e8b4429e8850067778a73cb581
child 436149 f5becc2dcc8ed9350b7f3a1742276839d2e79dc3
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewerserahm
bugs1416038
milestone59.0a1
Bug 1416038 (part 10) - nsSAXXMLReader.cpp doesn't need to be an nsIExtendedExpatSink. r=erahm
parser/xml/nsSAXXMLReader.cpp
parser/xml/nsSAXXMLReader.h
--- a/parser/xml/nsSAXXMLReader.cpp
+++ b/parser/xml/nsSAXXMLReader.cpp
@@ -31,29 +31,29 @@ NS_IMPL_CYCLE_COLLECTION(nsSAXXMLReader,
                          mBaseURI,
                          mListener,
                          mParserObserver)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSAXXMLReader)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSAXXMLReader)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSAXXMLReader)
   NS_INTERFACE_MAP_ENTRY(nsISAXXMLReader)
   NS_INTERFACE_MAP_ENTRY(nsIExpatSink)
-  NS_INTERFACE_MAP_ENTRY(nsIExtendedExpatSink)
   NS_INTERFACE_MAP_ENTRY(nsIContentSink)
   NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
   NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISAXXMLReader)
 NS_INTERFACE_MAP_END
 
 nsSAXXMLReader::nsSAXXMLReader()
   : mIsAsyncParse(false)
 {
 }
 
 // nsIContentSink
+
 NS_IMETHODIMP
 nsSAXXMLReader::WillBuildModel(nsDTDMode)
 {
   if (mContentHandler)
     return mContentHandler->StartDocument();
 
   return NS_OK;
 }
@@ -68,17 +68,18 @@ nsSAXXMLReader::DidBuildModel(bool aTerm
 }
 
 NS_IMETHODIMP
 nsSAXXMLReader::SetParser(nsParserBase *aParser)
 {
   return NS_OK;
 }
 
-// nsIExtendedExpatSink
+// nsIExpatSink
+
 NS_IMETHODIMP
 nsSAXXMLReader::HandleStartElement(const char16_t *aName,
                                    const char16_t **aAtts,
                                    uint32_t aAttsCount,
                                    uint32_t aLineNumber)
 {
   if (!mContentHandler)
     return NS_OK;
@@ -129,24 +130,16 @@ nsSAXXMLReader::HandleCDataSection(const
   if (mContentHandler) {
     nsresult rv = mContentHandler->Characters(Substring(aData, aData+aLength));
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSAXXMLReader::HandleStartDTD(const char16_t *aName,
-                               const char16_t *aSystemId,
-                               const char16_t *aPublicId)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsSAXXMLReader::HandleDoctypeDecl(const nsAString & aSubset,
                                   const nsAString & aName,
                                   const nsAString & aSystemId,
                                   const nsAString & aPublicId,
                                   nsISupports* aCatalogData)
 {
   return NS_OK;
 }
@@ -157,61 +150,29 @@ nsSAXXMLReader::HandleCharacterData(cons
 {
   if (mContentHandler)
     return mContentHandler->Characters(Substring(aData, aData+aLength));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSAXXMLReader::HandleStartNamespaceDecl(const char16_t *aPrefix,
-                                         const char16_t *aUri)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleEndNamespaceDecl(const char16_t *aPrefix)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsSAXXMLReader::HandleProcessingInstruction(const char16_t *aTarget,
                                             const char16_t *aData)
 {
   NS_ASSERTION(aTarget && aData, "null passed to handler");
   if (mContentHandler) {
     return mContentHandler->ProcessingInstruction(nsDependentString(aTarget),
                                                   nsDependentString(aData));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSAXXMLReader::HandleNotationDecl(const char16_t *aNotationName,
-                                   const char16_t *aSystemId,
-                                   const char16_t *aPublicId)
-{
-  NS_ASSERTION(aNotationName, "null passed to handler");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleUnparsedEntityDecl(const char16_t *aEntityName,
-                                         const char16_t *aSystemId,
-                                         const char16_t *aPublicId,
-                                         const char16_t *aNotationName)
-{
-  NS_ASSERTION(aEntityName && aNotationName, "null passed to handler");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsSAXXMLReader::HandleXMLDeclaration(const char16_t *aVersion,
                                      const char16_t *aEncoding,
                                      int32_t aStandalone)
 {
   NS_ASSERTION(aVersion, "null passed to handler");
   return NS_OK;
 }
 
--- a/parser/xml/nsSAXXMLReader.h
+++ b/parser/xml/nsSAXXMLReader.h
@@ -3,40 +3,39 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSAXXMLReader_h__
 #define nsSAXXMLReader_h__
 
 #include "nsCOMPtr.h"
 #include "nsIContentSink.h"
-#include "nsIExtendedExpatSink.h"
+#include "nsIExpatSink.h"
 #include "nsIParser.h"
 #include "nsIURI.h"
 #include "nsISAXXMLReader.h"
 #include "nsISAXContentHandler.h"
 #include "nsISAXErrorHandler.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/NotNull.h"
 
 #define NS_SAXXMLREADER_CONTRACTID "@mozilla.org/saxparser/xmlreader;1"
 #define NS_SAXXMLREADER_CID  \
 { 0xab1da296, 0x6125, 0x40ba, \
 { 0x96, 0xd0, 0x47, 0xa8, 0x28, 0x2a, 0xe3, 0xdb} }
 
 class nsSAXXMLReader final : public nsISAXXMLReader,
-                             public nsIExtendedExpatSink,
+                             public nsIExpatSink,
                              public nsIContentSink
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsSAXXMLReader, nsISAXXMLReader)
   NS_DECL_NSIEXPATSINK
-  NS_DECL_NSIEXTENDEDEXPATSINK
   NS_DECL_NSISAXXMLREADER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   nsSAXXMLReader();
 
   //nsIContentSink
   NS_IMETHOD WillParse() override