bug 366559 - patch 4, fix nsHTTPCompressConv namespace r=bagder

This commit is contained in:
Patrick McManus 2015-09-18 21:24:28 -04:00
parent a2e1d4e4d9
commit 41fd8ca785
3 changed files with 16 additions and 4 deletions

View File

@ -431,7 +431,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsTXTToHTMLConv, Init)
nsresult NS_NewMultiMixedConv (nsMultiMixedConv** result);
nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result);
nsresult NS_NewHTTPCompressConv (nsHTTPCompressConv ** result);
nsresult NS_NewHTTPCompressConv (mozilla::net::nsHTTPCompressConv ** result);
nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
#define FTP_TO_INDEX "?from=text/ftp-dir&to=application/http-index-format"
@ -585,7 +585,7 @@ CreateNewHTTPCompressConvFactory (nsISupports* aOuter, REFNSIID aIID, void **aRe
*aResult = nullptr;
return NS_ERROR_NO_AGGREGATION;
}
nsHTTPCompressConv* inst = nullptr;
mozilla::net::nsHTTPCompressConv* inst = nullptr;
nsresult rv = NS_NewHTTPCompressConv (&inst);
if (NS_FAILED(rv)) {
*aResult = nullptr;

View File

@ -15,6 +15,9 @@
#include "nsThreadUtils.h"
#include "mozilla/Preferences.h"
namespace mozilla {
namespace net {
// nsISupports implementation
NS_IMPL_ISUPPORTS(nsHTTPCompressConv,
nsIStreamConverter,
@ -486,8 +489,11 @@ nsHTTPCompressConv::check_header(nsIInputStream *iStr, uint32_t streamLen, nsres
return streamLen;
}
} // namespace net
} // namespace mozilla
nsresult
NS_NewHTTPCompressConv(nsHTTPCompressConv **aHTTPCompressConv)
NS_NewHTTPCompressConv(mozilla::net::nsHTTPCompressConv **aHTTPCompressConv)
{
NS_PRECONDITION(aHTTPCompressConv != nullptr, "null ptr");
@ -495,7 +501,7 @@ NS_NewHTTPCompressConv(nsHTTPCompressConv **aHTTPCompressConv)
return NS_ERROR_NULL_POINTER;
}
*aHTTPCompressConv = new nsHTTPCompressConv();
*aHTTPCompressConv = new mozilla::net::nsHTTPCompressConv();
if (!*aHTTPCompressConv) {
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -32,6 +32,9 @@ class nsIStringInputStream;
#define HTTP_IDENTITY_TYPE "identity"
#define HTTP_UNCOMPRESSED_TYPE "uncompressed"
namespace mozilla {
namespace net {
typedef enum {
HTTP_COMPRESS_GZIP,
HTTP_COMPRESS_DEFLATE,
@ -82,4 +85,7 @@ private:
uint32_t check_header (nsIInputStream *iStr, uint32_t streamLen, nsresult *rv);
};
} // namespace net
} // namespace mozilla
#endif