diff --git a/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp b/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp index e1234c60157..42522df0fbc 100644 --- a/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp +++ b/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp @@ -176,26 +176,28 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, // RSS 0.91/0.92/2.0 dataString.BeginReading(start_iter); dataString.EndReading(end_iter); - isFeed = FindInReadable(NS_LITERAL_CSTRING("Append(rawSegment, count); + *writeCount = count; + return NS_OK; +} + NS_IMETHODIMP nsFeedSniffer::OnDataAvailable(nsIRequest* request, nsISupports* context, nsIInputStream* stream, PRUint32 offset, PRUint32 count) { - char* decodedBytes = (char*)PR_Malloc(sizeof(char) * count); PRUint32 read; - nsresult rv = stream->Read(decodedBytes, count, &read); - if (NS_SUCCEEDED(rv)) - mDecodedData.Append(decodedBytes, read); - - PR_Free(decodedBytes); - decodedBytes = nsnull; - - return rv; + return stream->ReadSegments(AppendSegmentToString, &mDecodedData, count, + &read); } NS_IMETHODIMP diff --git a/mozilla/browser/components/feeds/src/nsFeedSniffer.h b/mozilla/browser/components/feeds/src/nsFeedSniffer.h index f5173d43f71..959b6a642cc 100644 --- a/mozilla/browser/components/feeds/src/nsFeedSniffer.h +++ b/mozilla/browser/components/feeds/src/nsFeedSniffer.h @@ -49,10 +49,18 @@ public: NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER + static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream, + void* closure, + const char* rawSegment, + PRUint32 toOffset, + PRUint32 count, + PRUint32* writeCount); + static NS_METHOD Register(nsIComponentManager* compMgr, nsIFile* path, const char* registryLocation, const char* componentType, const nsModuleComponentInfo *info); + protected: nsresult ConvertEncodedData(nsIRequest* request, const PRUint8* data, PRUint32 length); diff --git a/mozilla/configure.in b/mozilla/configure.in index 2c0db73e155..b4c11d0c9c3 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -4312,7 +4312,7 @@ MOZ_CALENDAR= MOZ_DBGRINFO_MODULES= MOZ_ENABLE_CANVAS=1 MOZ_EXTENSIONS_ALL=" cookie wallet xml-rpc help p3p venkman inspector irc typeaheadfind spellcheck gnomevfs sroaming xmlterm datetime finger cview layout-debug tasks sql xforms permissions schema-validation reporter safe-browsing" -MOZ_FEEDS= +MOZ_FEEDS=1 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon" MOZ_IMG_ENCODERS_DEFAULT="png jpeg" MOZ_IPCD= @@ -5773,9 +5773,9 @@ dnl ======================================================== dnl = Enable feeds (new feed handling/processing - Firefox) dnl ======================================================== MOZ_ARG_ENABLE_BOOL(feeds, -[ --enable-feeds Enable in-page feed handling and processing (Firefox)], - MOZ_FEEDS=1, - MOZ_FEEDS= ) +[ --disable-feeds Enable in-page feed handling and processing (Firefox)], + MOZ_FEEDS=, + MOZ_FEEDS=1 ) if test -n "$MOZ_FEEDS"; then AC_DEFINE(MOZ_FEEDS) fi