michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsIContentSniffer.h" michael@0: #include "nsIStreamListener.h" michael@0: #include "nsStringAPI.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsFeedSniffer MOZ_FINAL : public nsIContentSniffer, michael@0: nsIStreamListener michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICONTENTSNIFFER michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: michael@0: static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream, michael@0: void* closure, michael@0: const char* rawSegment, michael@0: uint32_t toOffset, michael@0: uint32_t count, michael@0: uint32_t* writeCount); michael@0: michael@0: protected: michael@0: nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data, michael@0: uint32_t length); michael@0: michael@0: private: michael@0: nsCString mDecodedData; michael@0: }; michael@0: