Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsSAXXMLReader_h__ |
michael@0 | 7 | #define nsSAXXMLReader_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsCOMPtr.h" |
michael@0 | 10 | #include "nsIContentSink.h" |
michael@0 | 11 | #include "nsIExtendedExpatSink.h" |
michael@0 | 12 | #include "nsIParser.h" |
michael@0 | 13 | #include "nsIURI.h" |
michael@0 | 14 | #include "nsISAXXMLReader.h" |
michael@0 | 15 | #include "nsISAXContentHandler.h" |
michael@0 | 16 | #include "nsISAXDTDHandler.h" |
michael@0 | 17 | #include "nsISAXErrorHandler.h" |
michael@0 | 18 | #include "nsISAXLexicalHandler.h" |
michael@0 | 19 | #include "nsIMozSAXXMLDeclarationHandler.h" |
michael@0 | 20 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 21 | #include "mozilla/Attributes.h" |
michael@0 | 22 | |
michael@0 | 23 | #define NS_SAXXMLREADER_CONTRACTID "@mozilla.org/saxparser/xmlreader;1" |
michael@0 | 24 | #define NS_SAXXMLREADER_CID \ |
michael@0 | 25 | { 0xab1da296, 0x6125, 0x40ba, \ |
michael@0 | 26 | { 0x96, 0xd0, 0x47, 0xa8, 0x28, 0x2a, 0xe3, 0xdb} } |
michael@0 | 27 | |
michael@0 | 28 | class nsSAXXMLReader MOZ_FINAL : public nsISAXXMLReader, |
michael@0 | 29 | public nsIExtendedExpatSink, |
michael@0 | 30 | public nsIContentSink |
michael@0 | 31 | { |
michael@0 | 32 | public: |
michael@0 | 33 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 34 | NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsSAXXMLReader, nsISAXXMLReader) |
michael@0 | 35 | NS_DECL_NSIEXPATSINK |
michael@0 | 36 | NS_DECL_NSIEXTENDEDEXPATSINK |
michael@0 | 37 | NS_DECL_NSISAXXMLREADER |
michael@0 | 38 | NS_DECL_NSIREQUESTOBSERVER |
michael@0 | 39 | NS_DECL_NSISTREAMLISTENER |
michael@0 | 40 | |
michael@0 | 41 | nsSAXXMLReader(); |
michael@0 | 42 | |
michael@0 | 43 | //nsIContentSink |
michael@0 | 44 | NS_IMETHOD WillParse() |
michael@0 | 45 | { |
michael@0 | 46 | return NS_OK; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode); |
michael@0 | 50 | NS_IMETHOD DidBuildModel(bool aTerminated); |
michael@0 | 51 | NS_IMETHOD SetParser(nsParserBase* aParser); |
michael@0 | 52 | |
michael@0 | 53 | NS_IMETHOD WillInterrupt() |
michael@0 | 54 | { |
michael@0 | 55 | return NS_OK; |
michael@0 | 56 | } |
michael@0 | 57 | |
michael@0 | 58 | NS_IMETHOD WillResume() |
michael@0 | 59 | { |
michael@0 | 60 | return NS_OK; |
michael@0 | 61 | } |
michael@0 | 62 | |
michael@0 | 63 | virtual void FlushPendingNotifications(mozFlushType aType) |
michael@0 | 64 | { |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | NS_IMETHOD SetDocumentCharset(nsACString& aCharset) |
michael@0 | 68 | { |
michael@0 | 69 | return NS_OK; |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | virtual nsISupports *GetTarget() |
michael@0 | 73 | { |
michael@0 | 74 | return nullptr; |
michael@0 | 75 | } |
michael@0 | 76 | |
michael@0 | 77 | private: |
michael@0 | 78 | nsCOMPtr<nsISAXContentHandler> mContentHandler; |
michael@0 | 79 | nsCOMPtr<nsISAXDTDHandler> mDTDHandler; |
michael@0 | 80 | nsCOMPtr<nsISAXErrorHandler> mErrorHandler; |
michael@0 | 81 | nsCOMPtr<nsISAXLexicalHandler> mLexicalHandler; |
michael@0 | 82 | nsCOMPtr<nsIMozSAXXMLDeclarationHandler> mDeclarationHandler; |
michael@0 | 83 | nsCOMPtr<nsIURI> mBaseURI; |
michael@0 | 84 | nsCOMPtr<nsIStreamListener> mListener; |
michael@0 | 85 | nsCOMPtr<nsIRequestObserver> mParserObserver; |
michael@0 | 86 | bool mIsAsyncParse; |
michael@0 | 87 | static bool TryChannelCharset(nsIChannel *aChannel, |
michael@0 | 88 | int32_t& aCharsetSource, |
michael@0 | 89 | nsACString& aCharset); |
michael@0 | 90 | nsresult EnsureBaseURI(); |
michael@0 | 91 | nsresult InitParser(nsIRequestObserver *aListener, nsIChannel *aChannel); |
michael@0 | 92 | nsresult SplitExpatName(const char16_t *aExpatName, |
michael@0 | 93 | nsString &aURI, |
michael@0 | 94 | nsString &aLocalName, |
michael@0 | 95 | nsString &aQName); |
michael@0 | 96 | nsString mPublicId; |
michael@0 | 97 | nsString mSystemId; |
michael@0 | 98 | |
michael@0 | 99 | // Feature flags |
michael@0 | 100 | bool mEnableNamespacePrefixes; |
michael@0 | 101 | }; |
michael@0 | 102 | |
michael@0 | 103 | #endif // nsSAXXMLReader_h__ |