From 91c5f2c00b7638f4a9ed8e0da3d3bfb9e5a75186 Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Mon, 4 Jun 2001 22:59:22 +0000 Subject: [PATCH] Fix for bug 81751. Add define for mime type multipart/x-mixed-replace and multipart/byteranges. Also export nsIFileStreams.idl on Mac. R=varada, SR=mscott, A=asa --- gfx/src/nsImageNetContextAsync.cpp | 6 ++++-- modules/libpr0n/src/imgLoader.cpp | 7 +++++-- modules/plugin/base/src/nsPluginHostImpl.cpp | 3 ++- modules/plugin/nglsrc/nsPluginHostImpl.cpp | 3 ++- netwerk/base/public/MANIFEST_IDL | 1 + netwerk/mime/public/nsMimeTypes.h | 3 +++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gfx/src/nsImageNetContextAsync.cpp b/gfx/src/nsImageNetContextAsync.cpp index 0ede3cf8a86..01e2b8ade2d 100644 --- a/gfx/src/nsImageNetContextAsync.cpp +++ b/gfx/src/nsImageNetContextAsync.cpp @@ -50,6 +50,8 @@ #include "nsIStreamConverterService.h" #include "nsIPref.h" +#include "nsMimeTypes.h" + static NS_DEFINE_CID(kStreamConvServiceCID, NS_STREAMCONVERTERSERVICE_CID); static NS_DEFINE_IID(kIURLIID, NS_IURL_IID); static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); @@ -268,8 +270,8 @@ ImageConsumer::DoContent(const char * aContentType, nsAutoString contentType; contentType.AssignWithConversion(aContentType); - if (contentType.EqualsWithConversion("multipart/x-mixed-replace") - || contentType.EqualsWithConversion("multipart/mixed")) { + if (contentType.EqualsWithConversion(MULTIPART_MIXED_REPLACE) + || contentType.EqualsWithConversion(MULTIPART_MIXED)) { // if we're getting multipart data, we have to convert it. // so wedge the converter inbetween us and the consumer. mIsMulti= PR_TRUE; diff --git a/modules/libpr0n/src/imgLoader.cpp b/modules/libpr0n/src/imgLoader.cpp index 7ebaa74e572..dae4cf762dc 100644 --- a/modules/libpr0n/src/imgLoader.cpp +++ b/modules/libpr0n/src/imgLoader.cpp @@ -42,6 +42,9 @@ #include "ImageLogging.h" +#include "nsMimeTypes.h" + + NS_IMPL_ISUPPORTS1(imgLoader, imgILoader) imgLoader::imgLoader() @@ -341,14 +344,14 @@ NS_IMETHODIMP ProxyListener::OnStartRequest(nsIRequest *aRequest, nsISupports *c in the pipeline to handle the content and pass it along to our original listener. */ - if (NS_LITERAL_CSTRING("multipart/x-mixed-replace").Equals(contentType)) { + if (NS_LITERAL_CSTRING(MULTIPART_MIXED_REPLACE).Equals(contentType)) { nsCOMPtr convServ(do_GetService("@mozilla.org/streamConverters;1", &rv)); if (NS_SUCCEEDED(rv)) { nsCOMPtr toListener(mDestListener); nsCOMPtr fromListener; - rv = convServ->AsyncConvertData(NS_LITERAL_STRING("multipart/x-mixed-replace").get(), + rv = convServ->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_MIXED_REPLACE).get(), NS_LITERAL_STRING("*/*").get(), toListener, nsnull, diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index 1d32c62c8cc..4414dca367c 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -83,6 +83,7 @@ #include "nsICookieService.h" #include "nsIDOMPlugin.h" #include "nsIDOMMimeType.h" +#include "nsMimeTypes.h" #include "prprf.h" #if defined(XP_PC) && !defined(XP_OS2) @@ -1158,7 +1159,7 @@ nsPluginStreamInfo::RequestRead(nsByteRange* rangeList) if (NS_FAILED(rv)) return rv; - rv = serv->AsyncConvertData(NS_LITERAL_STRING("multipart/byteranges").get(), + rv = serv->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_BYTERANGES).get(), NS_LITERAL_STRING("*/*").get(), mPluginStreamListenerPeer, nsnull, diff --git a/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 1d32c62c8cc..4414dca367c 100644 --- a/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -83,6 +83,7 @@ #include "nsICookieService.h" #include "nsIDOMPlugin.h" #include "nsIDOMMimeType.h" +#include "nsMimeTypes.h" #include "prprf.h" #if defined(XP_PC) && !defined(XP_OS2) @@ -1158,7 +1159,7 @@ nsPluginStreamInfo::RequestRead(nsByteRange* rangeList) if (NS_FAILED(rv)) return rv; - rv = serv->AsyncConvertData(NS_LITERAL_STRING("multipart/byteranges").get(), + rv = serv->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_BYTERANGES).get(), NS_LITERAL_STRING("*/*").get(), mPluginStreamListenerPeer, nsnull, diff --git a/netwerk/base/public/MANIFEST_IDL b/netwerk/base/public/MANIFEST_IDL index 9d7c4b7483a..070fabc0398 100644 --- a/netwerk/base/public/MANIFEST_IDL +++ b/netwerk/base/public/MANIFEST_IDL @@ -18,6 +18,7 @@ nsISocketTransportService.idl nsIStreamIO.idl nsIStreamIOChannel.idl nsIStreamListener.idl +nsIFileStreams.idl nsITransport.idl nsIStreamLoader.idl nsIDownloader.idl diff --git a/netwerk/mime/public/nsMimeTypes.h b/netwerk/mime/public/nsMimeTypes.h index 9227a2ac84b..f9f932663a8 100644 --- a/netwerk/mime/public/nsMimeTypes.h +++ b/netwerk/mime/public/nsMimeTypes.h @@ -99,6 +99,9 @@ #define MULTIPART_PARALLEL "multipart/parallel" #define MULTIPART_SIGNED "multipart/signed" #define MULTIPART_RELATED "multipart/related" +#define MULTIPART_MIXED_REPLACE "multipart/x-mixed-replace" +#define MULTIPART_BYTERANGES "multipart/byteranges" + #define SUN_ATTACHMENT "x-sun-attachment" #define TEXT_ENRICHED "text/enriched"