2006-04-27 04:24:12 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
2006-04-27 04:24:12 +04:00
|
|
|
|
|
|
|
|
|
|
|
#include "nsIContentSniffer.h"
|
|
|
|
#include "nsIStreamListener.h"
|
2006-11-13 20:53:01 +03:00
|
|
|
#include "nsStringAPI.h"
|
2012-06-20 07:24:24 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2006-04-27 04:24:12 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsFeedSniffer final : public nsIContentSniffer,
|
2012-06-20 07:24:24 +04:00
|
|
|
nsIStreamListener
|
2006-04-27 04:24:12 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICONTENTSNIFFER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
|
|
|
|
2006-05-05 01:57:18 +04:00
|
|
|
static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream,
|
|
|
|
void* closure,
|
|
|
|
const char* rawSegment,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t toOffset,
|
|
|
|
uint32_t count,
|
|
|
|
uint32_t* writeCount);
|
2006-05-05 01:57:18 +04:00
|
|
|
|
2006-04-27 04:24:12 +04:00
|
|
|
protected:
|
2014-06-24 02:40:03 +04:00
|
|
|
~nsFeedSniffer() {}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data,
|
|
|
|
uint32_t length);
|
2006-04-27 04:24:12 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsCString mDecodedData;
|
|
|
|
};
|
|
|
|
|