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 78a392e53d
commit db41bb4d4f
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 NS_NewMultiMixedConv (nsMultiMixedConv** result);
nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result); nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result);
nsresult NS_NewHTTPCompressConv (nsHTTPCompressConv ** result); nsresult NS_NewHTTPCompressConv (mozilla::net::nsHTTPCompressConv ** result);
nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv); nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
#define FTP_TO_INDEX "?from=text/ftp-dir&to=application/http-index-format" #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; *aResult = nullptr;
return NS_ERROR_NO_AGGREGATION; return NS_ERROR_NO_AGGREGATION;
} }
nsHTTPCompressConv* inst = nullptr; mozilla::net::nsHTTPCompressConv* inst = nullptr;
nsresult rv = NS_NewHTTPCompressConv (&inst); nsresult rv = NS_NewHTTPCompressConv (&inst);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
*aResult = nullptr; *aResult = nullptr;

View File

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

View File

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