Bug 827032 - Enable FAIL_ON_WARNINGS on MSVC in netwerk/. r=jduell
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Fri, 08 Feb 2013 20:49:30 +0900
changeset 131944 8ee3745570f7a1c2265b78c1c3c4d9b51e36ce50
parent 131943 4c82d38cb905c727a7048ec8f647521db372ff38
child 131945 3f192cae69e2c7d3087470c6191e2128e00ebb08
push id317
push userbbajaj@mozilla.com
push dateTue, 07 May 2013 01:20:33 +0000
treeherdermozilla-release@159a10910249 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs827032
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 827032 - Enable FAIL_ON_WARNINGS on MSVC in netwerk/. r=jduell
netwerk/base/src/DashboardTypes.h
netwerk/base/src/Makefile.in
netwerk/base/src/nsSocketTransport2.cpp
netwerk/base/src/nsSocketTransportService2.cpp
netwerk/base/src/nsStandardURL.cpp
netwerk/base/src/nsStreamTransportService.cpp
netwerk/build/Makefile.in
netwerk/cache/Makefile.in
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDeleteDir.cpp
netwerk/cookie/Makefile.in
netwerk/cookie/nsCookieService.cpp
netwerk/dns/Makefile.in
netwerk/protocol/http/Makefile.in
netwerk/protocol/http/nsHttpAuthCache.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/res/Makefile.in
netwerk/protocol/websocket/Makefile.in
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannelChild.cpp
netwerk/protocol/wyciwyg/Makefile.in
netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
netwerk/streamconv/converters/Makefile.in
netwerk/streamconv/converters/nsMultiMixedConv.cpp
--- a/netwerk/base/src/DashboardTypes.h
+++ b/netwerk/base/src/DashboardTypes.h
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef nsDashboardTypes__
-#define nsDashboardTypes__
+#ifndef mozilla_net_DashboardTypes_h_
+#define mozilla_net_DashboardTypes_h_
 
 namespace mozilla {
 namespace net {
 
 struct SocketInfo
 {
     nsCString host;
     uint64_t  sent;
@@ -17,17 +17,17 @@ struct SocketInfo
     bool      active;
     bool      tcp;
 };
 
 struct DNSCacheEntries
 {
     nsCString hostname;
     nsTArray<nsCString> hostaddr;
-    int8_t family;
+    uint16_t family;
     int64_t expiration;
 };
 
 struct HttpConnInfo
 {
     uint32_t ttl;
     uint32_t rtt;
 };
@@ -40,9 +40,9 @@ struct HttpRetParams
     uint32_t  counter;
     uint16_t  port;
     bool      spdy;
     bool      ssl;
 };
 
 } }
 
-#endif // nsDashboardTypes__
+#endif // mozilla_net_DashboardTypes_h_
--- a/netwerk/base/src/Makefile.in
+++ b/netwerk/base/src/Makefile.in
@@ -9,19 +9,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= necko
 LIBRARY_NAME	= neckobase_s
 LIBXUL_LIBRARY  = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 EXPORTS = \
 		nsMIMEInputStream.h \
 		nsURLHelper.h \
 		nsFileStreams.h \
 		$(NULL)
 
 EXPORTS_NAMESPACES = mozilla/net
--- a/netwerk/base/src/nsSocketTransport2.cpp
+++ b/netwerk/base/src/nsSocketTransport2.cpp
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG
 #endif
 
 #include "nsSocketTransport2.h"
+#include "base/compiler_specific.h"
 #include "nsAtomicRefcnt.h"
 #include "nsIOService.h"
 #include "nsStreamUtils.h"
 #include "nsNetSegmentUtils.h"
 #include "nsNetAddr.h"
 #include "nsTransportUtils.h"
 #include "nsProxyInfo.h"
 #include "nsNetCID.h"
@@ -691,18 +692,18 @@ nsSocketTransport::nsSocketTransport()
     , mInputClosed(true)
     , mOutputClosed(true)
     , mResolving(false)
     , mNetAddrIsSet(false)
     , mLock("nsSocketTransport.mLock")
     , mFD(nullptr)
     , mFDref(0)
     , mFDconnected(false)
-    , mInput(this)
-    , mOutput(this)
+    , ALLOW_THIS_IN_INITIALIZER_LIST(mInput(this))
+    , ALLOW_THIS_IN_INITIALIZER_LIST(mOutput(this))
     , mQoSBits(0x00)
 {
     SOCKET_LOG(("creating nsSocketTransport @%x\n", this));
 
     NS_ADDREF(gSocketTransportService);
 
     mTimeouts[TIMEOUT_CONNECT]    = UINT16_MAX; // no timeout
     mTimeouts[TIMEOUT_READ_WRITE] = UINT16_MAX; // no timeout
--- a/netwerk/base/src/nsSocketTransportService2.cpp
+++ b/netwerk/base/src/nsSocketTransportService2.cpp
@@ -625,17 +625,17 @@ nsSocketTransportService::Run()
 
     nsIThread *thread = NS_GetCurrentThread();
 
     // hook ourselves up to observe event processing for this thread
     nsCOMPtr<nsIThreadInternal> threadInt = do_QueryInterface(thread);
     threadInt->SetObserver(this);
 
     // make sure the pseudo random number generator is seeded on this thread
-    srand(PR_Now());
+    srand(static_cast<unsigned>(PR_Now()));
 
     for (;;) {
         bool pendingEvents = false;
         thread->HasPendingEvents(&pendingEvents);
 
         do {
             // If there are pending events for this thread then
             // DoPollIteration() should service the network without blocking.
--- a/netwerk/base/src/nsStandardURL.cpp
+++ b/netwerk/base/src/nsStandardURL.cpp
@@ -1525,17 +1525,17 @@ nsStandardURL::SetPort(int32_t port)
         ShiftFromPath(buf.Length());
     }
     else if (port == -1 || port == mDefaultPort) {
         // Don't allow mPort == mDefaultPort
         port = -1;
 
         // need to remove the port number from the URL spec
         uint32_t start = mHost.mPos + mHost.mLen;
-        uint32_t lengthToCut = mPath.mPos - start;
+        int32_t lengthToCut = mPath.mPos - start;
         mSpec.Cut(start, lengthToCut);
         mAuthority.mLen -= lengthToCut;
         ShiftFromPath(-lengthToCut);
     }
     else {
         // need to replace the existing port
         nsAutoCString buf;
         buf.AppendInt(port);
--- a/netwerk/base/src/nsStreamTransportService.cpp
+++ b/netwerk/base/src/nsStreamTransportService.cpp
@@ -181,24 +181,24 @@ nsInputStreamTransport::Read(char *buf, 
                     seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
             }
             // reset offset to zero so we can use it to enforce limit
             mOffset = 0;
         }
     }
 
     // limit amount read
-    uint32_t max = mLimit - mOffset;
+    uint64_t max = mLimit - mOffset;
     if (max == 0) {
         *result = 0;
         return NS_OK;
     }
-        
+
     if (count > max)
-        count = max;
+        count = static_cast<uint32_t>(max);
 
     nsresult rv = mSource->Read(buf, count, result);
 
     if (NS_SUCCEEDED(rv)) {
         mOffset += *result;
         if (mEventSink)
             mEventSink->OnTransportStatus(this, NS_NET_STATUS_READING, mOffset,
                                           mLimit);
@@ -381,24 +381,24 @@ nsOutputStreamTransport::Write(const cha
                     seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
             }
             // reset offset to zero so we can use it to enforce limit
             mOffset = 0;
         }
     }
 
     // limit amount written
-    uint32_t max = mLimit - mOffset;
+    uint64_t max = mLimit - mOffset;
     if (max == 0) {
         *result = 0;
         return NS_OK;
     }
-        
+
     if (count > max)
-        count = max;
+        count = static_cast<uint32_t>(max);
 
     nsresult rv = mSink->Write(buf, count, result);
 
     if (NS_SUCCEEDED(rv)) {
         mOffset += *result;
         if (mEventSink)
             mEventSink->OnTransportStatus(this, NS_NET_STATUS_WRITING, mOffset,
                                           mLimit);
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -12,19 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE         = necko
 LIBRARY_NAME   = necko
 EXPORT_LIBRARY = 1
 IS_COMPONENT   = 1
 MODULE_NAME    = necko
 GRE_MODULE     = 1
 LIBXUL_LIBRARY = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 CPPSRCS = nsNetModule.cpp
 EXPORTS = nsNetCID.h
 
 SHARED_LIBRARY_LIBS = \
   ../base/src/$(LIB_PREFIX)neckobase_s.$(LIB_SUFFIX) \
   ../dns/$(LIB_PREFIX)neckodns_s.$(LIB_SUFFIX) \
   ../socket/$(LIB_PREFIX)neckosocket_s.$(LIB_SUFFIX) \
--- a/netwerk/cache/Makefile.in
+++ b/netwerk/cache/Makefile.in
@@ -10,19 +10,17 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = nkcache
 LIBRARY_NAME   = nkcache_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE   = necko_cache
 GRE_MODULE     = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 FORCE_STATIC_LIB = 1
 
 XPIDLSRCS = \
   nsICache.idl \
   nsICacheEntryDescriptor.idl \
   nsICacheListener.idl \
   nsICacheService.idl \
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -570,40 +570,40 @@ SmartCacheSize(const uint32_t availKB, b
     // Grow/shrink in 10 MB units, deliberately, so that in the common case we
     // don't shrink cache and evict items every time we startup (it's important
     // that we don't slow down startup benchmarks).
     uint32_t sz10MBs = 0;
     uint32_t avail10MBs = availKB / (1024*10);
 
     // .5% of space above 25 GB
     if (avail10MBs > 2500) {
-        sz10MBs += (avail10MBs - 2500)*.005;
+        sz10MBs += static_cast<uint32_t>((avail10MBs - 2500)*.005);
         avail10MBs = 2500;
     }
     // 1% of space between 7GB -> 25 GB
     if (avail10MBs > 700) {
-        sz10MBs += (avail10MBs - 700)*.01;
+        sz10MBs += static_cast<uint32_t>((avail10MBs - 700)*.01);
         avail10MBs = 700;
     }
     // 5% of space between 500 MB -> 7 GB
     if (avail10MBs > 50) {
-        sz10MBs += (avail10MBs - 50)*.05;
+        sz10MBs += static_cast<uint32_t>((avail10MBs - 50)*.05);
         avail10MBs = 50;
     }
 
 #ifdef ANDROID
     // On Android, smaller/older devices may have very little storage and
     // device owners may be sensitive to storage footprint: Use a smaller
     // percentage of available space and a smaller minimum.
 
     // 20% of space up to 500 MB (10 MB min)
-    sz10MBs += std::max<uint32_t>(1, avail10MBs * .2);
+    sz10MBs += std::max<uint32_t>(1, static_cast<uint32_t>(avail10MBs * .2));
 #else
     // 40% of space up to 500 MB (50 MB min)
-    sz10MBs += std::max<uint32_t>(5, avail10MBs * .4);
+    sz10MBs += std::max<uint32_t>(5, static_cast<uint32_t>(avail10MBs * .4));
 #endif
 
     return std::min<uint32_t>(maxSize, sz10MBs * 10 * 1024);
 }
 
  /* Computes our best guess for the default size of the user's disk cache, 
   * based on the amount of space they have free on their hard drive. 
   * We use a tiered scheme: the more space available, 
@@ -629,17 +629,18 @@ nsCacheProfilePrefObserver::GetSmartCach
     rv = cacheDirectory->InitWithPath(cachePath);
     if (NS_FAILED(rv))
         return DEFAULT_CACHE_SIZE;
     int64_t bytesAvailable;
     rv = cacheDirectory->GetDiskSpaceAvailable(&bytesAvailable);
     if (NS_FAILED(rv))
         return DEFAULT_CACHE_SIZE;
 
-    return SmartCacheSize((bytesAvailable / 1024) + currentSize,
+    return SmartCacheSize(static_cast<uint32_t>((bytesAvailable / 1024) +
+                                                currentSize),
                           shouldUseOldMaxSmartSize);
 }
 
 /* Determine if we are permitted to dynamically size the user's disk cache based
  * on their disk space available. We may do this so long as the pref 
  * smart_size.enabled is true.
  */
 bool
--- a/netwerk/cache/nsDeleteDir.cpp
+++ b/netwerk/cache/nsDeleteDir.cpp
@@ -219,17 +219,17 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, b
     if (NS_FAILED(rv))
       return rv;
     nsAutoCString origLeaf;
     rv = trash->GetNativeLeafName(origLeaf);
     if (NS_FAILED(rv))
       return rv;
 
     // Append random number to the trash directory and check if it exists.
-    srand(PR_Now());
+    srand(static_cast<unsigned>(PR_Now()));
     nsAutoCString leaf;
     for (int32_t i = 0; i < 10; i++) {
       leaf = origLeaf;
       leaf.AppendInt(rand());
       rv = trash->SetNativeLeafName(leaf);
       if (NS_FAILED(rv))
         return rv;
 
--- a/netwerk/cookie/Makefile.in
+++ b/netwerk/cookie/Makefile.in
@@ -10,19 +10,17 @@ VPATH     = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 # export required interfaces, even if --disable-cookies has been given
 MODULE       = necko
 XPIDL_MODULE = necko_cookie
 GRE_MODULE   = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 SDK_XPIDLSRCS = \
   nsICookie.idl \
   nsICookieManager.idl \
   $(NULL)
 
 XPIDLSRCS = \
   nsICookie2.idl \
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -80,17 +80,17 @@ static const int64_t kCookiePurgeAge =
   int64_t(30 * 24 * 60 * 60) * PR_USEC_PER_SEC; // 30 days in microseconds
 
 static const char kOldCookieFileName[] = "cookies.txt";
 
 #undef  LIMIT
 #define LIMIT(x, low, high, default) ((x) >= (low) && (x) <= (high) ? (x) : (default))
 
 #undef  ADD_TEN_PERCENT
-#define ADD_TEN_PERCENT(i) ((i) + (i)/10)
+#define ADD_TEN_PERCENT(i) static_cast<uint32_t>((i) + (i)/10)
 
 // default limits for the cookie list. these can be tuned by the
 // network.cookie.maxNumber and network.cookie.maxPerHost prefs respectively.
 static const uint32_t kMaxNumberOfCookies = 3000;
 static const uint32_t kMaxCookiesPerHost  = 150;
 static const uint32_t kMaxBytesPerCookie  = 4096;
 static const uint32_t kMaxBytesPerPath    = 1024;
 
--- a/netwerk/dns/Makefile.in
+++ b/netwerk/dns/Makefile.in
@@ -10,19 +10,17 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = necko
 LIBRARY_NAME   = neckodns_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE   = necko_dns
 GRE_MODULE     = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 XPIDLSRCS = \
   nsIDNSListener.idl \
   nsIDNSRecord.idl \
   nsIDNSService.idl \
   nsIEffectiveTLDService.idl \
   nsIIDNService.idl \
   nsPIDNSService.idl \
--- a/netwerk/protocol/http/Makefile.in
+++ b/netwerk/protocol/http/Makefile.in
@@ -11,19 +11,17 @@ VPATH     = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = necko
 LIBRARY_NAME   = nkhttp_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE   = necko_http
 GRE_MODULE     = 1
 FORCE_STATIC_LIB = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 EXPORTS_NAMESPACES = mozilla/net
 
 SDK_XPIDLSRCS = \
   nsIHttpChannel.idl \
   nsIHttpHeaderVisitor.idl \
   $(NULL)
 
--- a/netwerk/protocol/http/nsHttpAuthCache.cpp
+++ b/netwerk/protocol/http/nsHttpAuthCache.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsHttpAuthCache.h"
 #include <stdlib.h>
+#include "base/compiler_specific.h"
 #include "nsHttp.h"
-#include "nsHttpAuthCache.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "prprf.h"
 #include "mozIApplicationClearPrivateDataParams.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "nsNetUtil.h"
 
@@ -45,17 +46,17 @@ StrEquivalent(const PRUnichar *a, const 
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpAuthCache <public>
 //-----------------------------------------------------------------------------
 
 nsHttpAuthCache::nsHttpAuthCache()
     : mDB(nullptr)
-    , mObserver(new AppDataClearObserver(this))
+    , ALLOW_THIS_IN_INITIALIZER_LIST(mObserver(new AppDataClearObserver(this)))
 {
     nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
     if (obsSvc) {
         obsSvc->AddObserver(mObserver, "webapps-clear-data", false);
     }
 }
 
 nsHttpAuthCache::~nsHttpAuthCache()
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -2780,33 +2780,35 @@ nsHalfOpenSocket::OnOutputStreamReady(ns
     nsCOMPtr<nsIInterfaceRequestor> callbacks;
     mTransaction->GetSecurityCallbacks(getter_AddRefs(callbacks));
     if (out == mStreamOut) {
         TimeDuration rtt = TimeStamp::Now() - mPrimarySynStarted;
         rv = conn->Init(mEnt->mConnInfo,
                         gHttpHandler->ConnMgr()->mMaxRequestDelay,
                         mSocketTransport, mStreamIn, mStreamOut,
                         callbacks,
-                        PR_MillisecondsToInterval(rtt.ToMilliseconds()));
+                        PR_MillisecondsToInterval(
+                          static_cast<uint32_t>(rtt.ToMilliseconds())));
 
         if (NS_SUCCEEDED(mSocketTransport->GetPeerAddr(&peeraddr)))
             mEnt->RecordIPFamilyPreference(peeraddr.raw.family);
 
         // The nsHttpConnection object now owns these streams and sockets
         mStreamOut = nullptr;
         mStreamIn = nullptr;
         mSocketTransport = nullptr;
     }
     else {
         TimeDuration rtt = TimeStamp::Now() - mBackupSynStarted;
         rv = conn->Init(mEnt->mConnInfo,
                         gHttpHandler->ConnMgr()->mMaxRequestDelay,
                         mBackupTransport, mBackupStreamIn, mBackupStreamOut,
                         callbacks,
-                        PR_MillisecondsToInterval(rtt.ToMilliseconds()));
+                        PR_MillisecondsToInterval(
+                          static_cast<uint32_t>(rtt.ToMilliseconds())));
 
         if (NS_SUCCEEDED(mBackupTransport->GetPeerAddr(&peeraddr)))
             mEnt->RecordIPFamilyPreference(peeraddr.raw.family);
 
         // The nsHttpConnection object now owns these streams and sockets
         mBackupStreamOut = nullptr;
         mBackupStreamIn = nullptr;
         mBackupTransport = nullptr;
--- a/netwerk/protocol/res/Makefile.in
+++ b/netwerk/protocol/res/Makefile.in
@@ -10,19 +10,17 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = necko
 LIBRARY_NAME   = nkres_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE   = necko_res
 GRE_MODULE     = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
-endif # !_MSC_VER
 
 FORCE_STATIC_LIB = 1
 
 XPIDLSRCS = \
   nsIResProtocolHandler.idl \
   $(NULL)
 
 CPPSRCS = \
--- a/netwerk/protocol/websocket/Makefile.in
+++ b/netwerk/protocol/websocket/Makefile.in
@@ -10,19 +10,17 @@ VPATH     = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = necko
 LIBRARY_NAME   = nkwebsocket_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE   = necko_websocket
 GRE_MODULE     = 1
 FORCE_STATIC_LIB = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
-endif # !_MSC_VER
 
 EXPORTS_NAMESPACES = mozilla/net
 
 XPIDLSRCS = \
   nsIWebSocketChannel.idl \
   nsIWebSocketListener.idl \
   $(NULL)
 
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -120,17 +120,18 @@ public:
   }
 
   // Called to update settings when connection fails again.
   void FailedAgain()
   {
     mLastFailure = TimeStamp::Now();
     // We use a truncated exponential backoff as suggested by RFC 6455,
     // but multiply by 1.5 instead of 2 to be more gradual.
-    mNextDelay = std::min<double>(kWSReconnectMaxDelay, mNextDelay * 1.5);
+    mNextDelay = static_cast<uint32_t>(
+      std::min<double>(kWSReconnectMaxDelay, mNextDelay * 1.5));
     LOG(("WebSocket: FailedAgain: host=%s, port=%d: incremented delay to %lu",
          mAddress.get(), mPort, mNextDelay));
   }
 
   // returns 0 if there is no need to delay (i.e. delay interval is over)
   uint32_t RemainingDelay(TimeStamp rightNow)
   {
     TimeDuration dur = rightNow - mLastFailure;
@@ -1174,64 +1175,65 @@ WebSocketChannel::ProcessInput(uint8_t *
       return NS_ERROR_FILE_TOO_BIG;
     }
   }
 
   uint8_t *payload;
   uint32_t totalAvail = avail;
 
   while (avail >= 2) {
-    int64_t payloadLength = mFramePtr[1] & 0x7F;
-    uint8_t finBit        = mFramePtr[0] & kFinalFragBit;
-    uint8_t rsvBits       = mFramePtr[0] & 0x70;
-    uint8_t maskBit       = mFramePtr[1] & kMaskBit;
-    uint8_t opcode        = mFramePtr[0] & 0x0F;
+    int64_t payloadLength64 = mFramePtr[1] & 0x7F;
+    uint8_t finBit  = mFramePtr[0] & kFinalFragBit;
+    uint8_t rsvBits = mFramePtr[0] & 0x70;
+    uint8_t maskBit = mFramePtr[1] & kMaskBit;
+    uint8_t opcode  = mFramePtr[0] & 0x0F;
 
     uint32_t framingLength = 2;
     if (maskBit)
       framingLength += 4;
 
-    if (payloadLength < 126) {
+    if (payloadLength64 < 126) {
       if (avail < framingLength)
         break;
-    } else if (payloadLength == 126) {
+    } else if (payloadLength64 == 126) {
       // 16 bit length field
       framingLength += 2;
       if (avail < framingLength)
         break;
 
-      payloadLength = mFramePtr[2] << 8 | mFramePtr[3];
+      payloadLength64 = mFramePtr[2] << 8 | mFramePtr[3];
     } else {
       // 64 bit length
       framingLength += 8;
       if (avail < framingLength)
         break;
 
       if (mFramePtr[2] & 0x80) {
         // Section 4.2 says that the most significant bit MUST be
         // 0. (i.e. this is really a 63 bit value)
         LOG(("WebSocketChannel:: high bit of 64 bit length set"));
         return NS_ERROR_ILLEGAL_VALUE;
       }
 
       // copy this in case it is unaligned
       uint64_t tempLen;
       memcpy(&tempLen, mFramePtr + 2, 8);
-      payloadLength = PR_ntohll(tempLen);
+      payloadLength64 = PR_ntohll(tempLen);
     }
 
     payload = mFramePtr + framingLength;
     avail -= framingLength;
 
     LOG(("WebSocketChannel::ProcessInput: payload %lld avail %lu\n",
-         payloadLength, avail));
-
-    if (payloadLength + mFragmentAccumulator > mMaxMessageSize) {
+         payloadLength64, avail));
+
+    if (payloadLength64 + mFragmentAccumulator > mMaxMessageSize) {
       return NS_ERROR_FILE_TOO_BIG;
     }
+    uint32_t payloadLength = static_cast<uint32_t>(payloadLength64);
 
     if (avail < payloadLength)
       break;
 
     LOG(("WebSocketChannel::ProcessInput: Frame accumulated - opcode %d\n",
          opcode));
 
     if (maskBit) {
@@ -1261,17 +1263,17 @@ WebSocketChannel::ProcessInput(uint8_t *
 
       // Only the first frame has a non zero op code: Make sure we don't see a
       // first frame while some old fragments are open
       if ((mFragmentAccumulator != 0) && (opcode != kContinuation)) {
         LOG(("WebSocketChannel:: nested fragments\n"));
         return NS_ERROR_ILLEGAL_VALUE;
       }
 
-      LOG(("WebSocketChannel:: Accumulating Fragment %lld\n", payloadLength));
+      LOG(("WebSocketChannel:: Accumulating Fragment %ld\n", payloadLength));
 
       if (opcode == kContinuation) {
 
         // Make sure this continuation fragment isn't the first fragment
         if (mFragmentOpcode == kContinuation) {
           LOG(("WebSocketHeandler:: continuation code in first fragment\n"));
           return NS_ERROR_ILLEGAL_VALUE;
         }
@@ -1353,17 +1355,17 @@ WebSocketChannel::ProcessInput(uint8_t *
         LOG(("WebSocketChannel:: close received\n"));
         mServerClosed = 1;
 
         mServerCloseCode = CLOSE_NO_STATUS;
         if (payloadLength >= 2) {
           memcpy(&mServerCloseCode, payload, 2);
           mServerCloseCode = PR_ntohs(mServerCloseCode);
           LOG(("WebSocketChannel:: close recvd code %u\n", mServerCloseCode));
-          uint16_t msglen = payloadLength - 2;
+          uint16_t msglen = static_cast<uint16_t>(payloadLength - 2);
           if (msglen > 0) {
             mServerCloseReason.SetLength(msglen);
             memcpy(mServerCloseReason.BeginWriting(),
                    (const char *)payload + 2, msglen);
 
             // section 8.1 says to replace received non utf-8 sequences
             // (which are non-conformant to send) with u+fffd,
             // but secteam feels that silently rewriting messages is
--- a/netwerk/protocol/websocket/WebSocketChannelChild.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannelChild.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebSocketLog.h"
+#include "base/compiler_specific.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/net/NeckoChild.h"
 #include "WebSocketChannelChild.h"
 #include "nsITabChild.h"
 #include "nsILoadContext.h"
 #include "nsNetUtil.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
@@ -43,17 +44,17 @@ NS_IMETHODIMP_(nsrefcnt) WebSocketChanne
 
 NS_INTERFACE_MAP_BEGIN(WebSocketChannelChild)
   NS_INTERFACE_MAP_ENTRY(nsIWebSocketChannel)
   NS_INTERFACE_MAP_ENTRY(nsIProtocolHandler)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketChannel)
 NS_INTERFACE_MAP_END
 
 WebSocketChannelChild::WebSocketChannelChild(bool aSecure)
-: mEventQ(static_cast<nsIWebSocketChannel*>(this))
+: ALLOW_THIS_IN_INITIALIZER_LIST(mEventQ(static_cast<nsIWebSocketChannel*>(this)))
 , mIPCOpen(false)
 {
   LOG(("WebSocketChannelChild::WebSocketChannelChild() %p\n", this));
   BaseWebSocketChannel::mEncrypted = aSecure;
 }
 
 WebSocketChannelChild::~WebSocketChannelChild()
 {
--- a/netwerk/protocol/wyciwyg/Makefile.in
+++ b/netwerk/protocol/wyciwyg/Makefile.in
@@ -10,19 +10,17 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= necko
 LIBRARY_NAME	= nkwyciwyg_s
 LIBXUL_LIBRARY	= 1
 XPIDL_MODULE	= necko_wyciwyg
 GRE_MODULE	= 1
 FORCE_STATIC_LIB = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
-endif # !_MSC_VER
 
 EXPORTS_NAMESPACES = mozilla/net
 
 XPIDLSRCS	= \
 		nsIWyciwygChannel.idl \
 		$(NULL)
 
 EXPORTS_mozilla/net += \
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsWyciwyg.h"
 
+#include "base/compiler_specific.h"
+
 #include "mozilla/net/NeckoChild.h"
 #include "WyciwygChannelChild.h"
 #include "mozilla/dom/TabChild.h"
 
 #include "nsCharsetSource.h"
 #include "nsStringStream.h"
 #include "nsMimeTypes.h"
 #include "nsNetUtil.h"
@@ -34,17 +36,17 @@ WyciwygChannelChild::WyciwygChannelChild
   , mIsPending(false)
   , mCanceled(false)
   , mLoadFlags(LOAD_NORMAL)
   , mContentLength(-1)
   , mCharsetSource(kCharsetUninitialized)
   , mState(WCC_NEW)
   , mIPCOpen(false)
   , mSentAppData(false)
-  , mEventQ(NS_ISUPPORTS_CAST(nsIWyciwygChannel*, this))
+  , ALLOW_THIS_IN_INITIALIZER_LIST(mEventQ(NS_ISUPPORTS_CAST(nsIWyciwygChannel*, this)))
 {
   LOG(("Creating WyciwygChannelChild @%x\n", this));
 }
 
 WyciwygChannelChild::~WyciwygChannelChild()
 {
   LOG(("Destroying WyciwygChannelChild @%x\n", this));
 }
--- a/netwerk/streamconv/converters/Makefile.in
+++ b/netwerk/streamconv/converters/Makefile.in
@@ -8,19 +8,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= necko
 LIBRARY_NAME	= nkcnvts_s
 LIBXUL_LIBRARY = 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
-endif # !_MSC_VER
 
 
 CPPSRCS		= \
 		mozTXTToHTMLConv.cpp \
 		nsUnknownDecoder.cpp \
 		nsHTTPCompressConv.cpp \
 		nsTXTToHTMLConv.cpp \
 		nsDirIndex.cpp \
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -878,17 +878,17 @@ nsMultiMixedConv::SendData(char *aBuffer
     nsresult rv = NS_OK;
     
     if (!mPartChannel) return NS_ERROR_FAILURE; // something went wrong w/ processing
 
     if (mContentLength != UINT64_MAX) {
         // make sure that we don't send more than the mContentLength
         // XXX why? perhaps the Content-Length header was actually wrong!!
         if ((uint64_t(aLen) + mTotalSent) > mContentLength)
-            aLen = mContentLength - mTotalSent;
+            aLen = static_cast<uint32_t>(mContentLength - mTotalSent);
 
         if (aLen == 0)
             return NS_OK;
     }
 
     uint64_t offset = mTotalSent;
     mTotalSent += aLen;