bug 366559 - patch 4, fix nsHTTPCompressConv namespace r=bagder
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 18 Sep 2015 21:24:28 -0400
changeset 263811 9ce35eb8d2c4
parent 263810 6bfd3ac42ef0
child 263812 f504caa27f0a
push id29418
push userkwierso@gmail.com
push date2015-09-22 23:42 +0000
treeherdermozilla-central@05a7ee49d40a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs366559
milestone44.0a1
bug 366559 - patch 4, fix nsHTTPCompressConv namespace r=bagder
netwerk/build/nsNetModule.cpp
netwerk/streamconv/converters/nsHTTPCompressConv.cpp
netwerk/streamconv/converters/nsHTTPCompressConv.h
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -426,17 +426,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsTX
 
 #include "nsIndexedToHTML.h"
 #ifdef BUILD_BINHEX_DECODER
 #include "nsBinHexDecoder.h"
 #endif
 
 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"
 #define INDEX_TO_HTML                "?from=application/http-index-format&to=text/html"
 #define MULTI_MIXED_X                "?from=multipart/x-mixed-replace&to=*/*"
 #define MULTI_MIXED                  "?from=multipart/mixed&to=*/*"
 #define APPLICATION_PACKAGE_CONV     "?from=" APPLICATION_PACKAGE "&to=*/*"
 #define MULTI_BYTERANGES             "?from=multipart/byteranges&to=*/*"
@@ -580,17 +580,17 @@ CreateNewHTTPCompressConvFactory (nsISup
 {
     if (!aResult) {                                                  
         return NS_ERROR_INVALID_POINTER;                             
     }
     if (aOuter) {                                                    
         *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;                                           
         return rv;                                                   
     } 
     rv = inst->QueryInterface(aIID, aResult);
     if (NS_FAILED(rv)) {                                             
         *aResult = nullptr;                                           
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
@@ -10,16 +10,19 @@
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
 #include "nsComponentManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Preferences.h"
 
+namespace mozilla {
+namespace net {
+
 // nsISupports implementation
 NS_IMPL_ISUPPORTS(nsHTTPCompressConv,
                   nsIStreamConverter,
                   nsIStreamListener,
                   nsIRequestObserver)
 
 // nsFTPDirListingConv methods
 nsHTTPCompressConv::nsHTTPCompressConv()
@@ -481,26 +484,29 @@ nsHTTPCompressConv::check_header(nsIInpu
         return streamLen;
       }
       break;
     }
   }
   return streamLen;
 }
 
+} // namespace net
+} // namespace mozilla
+
 nsresult
-NS_NewHTTPCompressConv(nsHTTPCompressConv **aHTTPCompressConv)
+NS_NewHTTPCompressConv(mozilla::net::nsHTTPCompressConv **aHTTPCompressConv)
 {
   NS_PRECONDITION(aHTTPCompressConv != nullptr, "null ptr");
 
   if (!aHTTPCompressConv) {
     return NS_ERROR_NULL_POINTER;
   }
 
-  *aHTTPCompressConv = new nsHTTPCompressConv();
+  *aHTTPCompressConv = new mozilla::net::nsHTTPCompressConv();
 
   if (!*aHTTPCompressConv) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(*aHTTPCompressConv);
   return NS_OK;
 }
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.h
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h
@@ -27,16 +27,19 @@ class nsIStringInputStream;
 #define	HTTP_DEFLATE_TYPE		"deflate"
 #define	HTTP_GZIP_TYPE	        "gzip"
 #define	HTTP_X_GZIP_TYPE	    "x-gzip"
 #define	HTTP_COMPRESS_TYPE	    "compress"
 #define	HTTP_X_COMPRESS_TYPE	"x-compress"
 #define	HTTP_IDENTITY_TYPE	    "identity"
 #define	HTTP_UNCOMPRESSED_TYPE	"uncompressed"
 
+namespace mozilla {
+namespace net {
+
 typedef enum    {
   HTTP_COMPRESS_GZIP,
   HTTP_COMPRESS_DEFLATE,
   HTTP_COMPRESS_COMPRESS,
   HTTP_COMPRESS_IDENTITY
 } CompressMode;
 
 class nsHTTPCompressConv : public nsIStreamConverter	{
@@ -77,9 +80,12 @@ private:
     bool        mFailUncleanStops;
 
     z_stream d_stream;
     unsigned mLen, hMode, mSkipCount, mFlags;
 
     uint32_t check_header (nsIInputStream *iStr, uint32_t streamLen, nsresult *rv);
 };
 
+} // namespace net
+} // namespace mozilla
+
 #endif