nsFeedSniffer.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsIContentSniffer.h"
  6. #include "nsIStreamListener.h"
  7. #include "nsStringAPI.h"
  8. #include "mozilla/Attributes.h"
  9. class nsFeedSniffer final : public nsIContentSniffer,
  10. nsIStreamListener
  11. {
  12. public:
  13. NS_DECL_ISUPPORTS
  14. NS_DECL_NSICONTENTSNIFFER
  15. NS_DECL_NSIREQUESTOBSERVER
  16. NS_DECL_NSISTREAMLISTENER
  17. static nsresult AppendSegmentToString(nsIInputStream* inputStream,
  18. void* closure,
  19. const char* rawSegment,
  20. uint32_t toOffset,
  21. uint32_t count,
  22. uint32_t* writeCount);
  23. protected:
  24. ~nsFeedSniffer() {}
  25. nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data,
  26. uint32_t length);
  27. private:
  28. nsCString mDecodedData;
  29. };