browser/components/feeds/src/nsFeedSniffer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/feeds/src/nsFeedSniffer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +#include "nsIContentSniffer.h"
    1.11 +#include "nsIStreamListener.h"
    1.12 +#include "nsStringAPI.h"
    1.13 +#include "mozilla/Attributes.h"
    1.14 +
    1.15 +class nsFeedSniffer MOZ_FINAL : public nsIContentSniffer,
    1.16 +                                       nsIStreamListener
    1.17 +{
    1.18 +public:
    1.19 +  NS_DECL_ISUPPORTS
    1.20 +  NS_DECL_NSICONTENTSNIFFER
    1.21 +  NS_DECL_NSIREQUESTOBSERVER
    1.22 +  NS_DECL_NSISTREAMLISTENER
    1.23 +
    1.24 +  static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream,
    1.25 +                                         void* closure,
    1.26 +                                         const char* rawSegment,
    1.27 +                                         uint32_t toOffset,
    1.28 +                                         uint32_t count,
    1.29 +                                         uint32_t* writeCount);
    1.30 +
    1.31 +protected:
    1.32 +  nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data,
    1.33 +                              uint32_t length);
    1.34 +
    1.35 +private:
    1.36 +  nsCString mDecodedData;
    1.37 +};
    1.38 +

mercurial