Bug 1026336 - Fix warnings in content/media/webrtc and mark FAIL_ON_WARNINGS. r=jesup

This commit is contained in:
Chris Peterson 2014-06-15 11:57:30 -07:00
parent 2c6c9dce99
commit 6d73fa876a
8 changed files with 56 additions and 40 deletions

View File

@ -40,15 +40,15 @@ LoadManagerSingleton::LoadManagerSingleton(int aLoadMeasurementInterval,
int aAveragingMeasurements,
float aHighLoadThreshold,
float aLowLoadThreshold)
: mLoadSum(0.0f),
mLoadSumMeasurements(0),
: mLock("LoadManager"),
mCurrentState(webrtc::kLoadNormal),
mOveruseActive(false),
mLoadSum(0.0f),
mLoadSumMeasurements(0),
mLoadMeasurementInterval(aLoadMeasurementInterval),
mAveragingMeasurements(aAveragingMeasurements),
mHighLoadThreshold(aHighLoadThreshold),
mLowLoadThreshold(aLowLoadThreshold),
mCurrentState(webrtc::kLoadNormal),
mLock("LoadManager")
mLowLoadThreshold(aLowLoadThreshold)
{
#if defined(PR_LOGGING)
if (!gLoadManagerLog)

View File

@ -54,8 +54,8 @@ private:
nsRefPtr<LoadMonitor> mLoadMonitor;
// This protexts access to the mObservers list, the current state, pretty much all
// the other members (below)
// This protects access to the mObservers list, the current state, and
// pretty much all the other members (below).
Mutex mLock;
nsTArray<webrtc::CPULoadStateObserver*> mObservers;
webrtc::CPULoadState mCurrentState;

View File

@ -29,9 +29,9 @@ LoadManagerSingleton::Get() {
int averagingSeconds =
mozilla::Preferences::GetInt("media.navigator.load_adapt.avg_seconds", 3);
float highLoadThreshold =
mozilla::Preferences::GetFloat("media.navigator.load_adapt.high_load", 0.90);
mozilla::Preferences::GetFloat("media.navigator.load_adapt.high_load", 0.90f);
float lowLoadThreshold =
mozilla::Preferences::GetFloat("media.navigator.load_adapt.low_load", 0.40);
mozilla::Preferences::GetFloat("media.navigator.load_adapt.low_load", 0.40f);
sSingleton = new LoadManagerSingleton(loadMeasurementInterval,
averagingSeconds,

View File

@ -267,13 +267,13 @@ class MediaEngineWebRTCAudioSource : public MediaEngineAudioSource,
public:
MediaEngineWebRTCAudioSource(webrtc::VoiceEngine* aVoiceEnginePtr, int aIndex,
const char* name, const char* uuid)
: mVoiceEngine(aVoiceEnginePtr)
: mSamples(0)
, mVoiceEngine(aVoiceEnginePtr)
, mMonitor("WebRTCMic.Monitor")
, mCapIndex(aIndex)
, mChannel(-1)
, mInitDone(false)
, mStarted(false)
, mSamples(0)
, mEchoOn(false), mAgcOn(false), mNoiseOn(false)
, mEchoCancel(webrtc::kEcDefault)
, mAGC(webrtc::kAgcDefault)
@ -319,6 +319,13 @@ public:
NS_DECL_THREADSAFE_ISUPPORTS
protected:
// mSamples is an int to avoid conversions when comparing/etc to
// samplingFreq & length. Making mSamples protected instead of private is a
// silly way to avoid -Wunused-private-field warnings when PR_LOGGING is not
// #defined. mSamples is not actually expected to be used by a derived class.
int mSamples;
private:
static const unsigned int KMaxDeviceNameLength = 128;
static const unsigned int KMaxUniqueIdLength = 256;
@ -344,7 +351,6 @@ private:
TrackID mTrackID;
bool mInitDone;
bool mStarted;
int mSamples; // int to avoid conversions when comparing/etc to samplingFreq & length
nsString mDeviceName;
nsString mDeviceUUID;

View File

@ -6,6 +6,7 @@
#include "PeerIdentity.h"
#include "mozilla/DebugOnly.h"
#include "nsCOMPtr.h"
#include "nsIIDNService.h"
#include "nsNetCID.h"
@ -76,9 +77,9 @@ PeerIdentity::GetNormalizedHost(const nsCOMPtr<nsIIDNService>& aIdnService,
const nsAString& aHost,
nsACString& aNormalizedHost)
{
nsCString chost = NS_ConvertUTF16toUTF8(aHost);
nsresult rv = aIdnService->ConvertUTF8toACE(chost, aNormalizedHost);
NS_WARN_IF(NS_FAILED(rv));
const nsCString chost = NS_ConvertUTF16toUTF8(aHost);
DebugOnly<nsresult> rv = aIdnService->ConvertUTF8toACE(chost, aNormalizedHost);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to convert UTF-8 host to ASCII");
}
} /* namespace mozilla */

View File

@ -57,3 +57,11 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'gklayout'
if CONFIG['OS_ARCH'] == 'WINNT':
DEFINES['NOMINMAX'] = True
if CONFIG['_MSC_VER']:
CXXFLAGS += [
'-wd4275', # non dll-interface class used as base for dll-interface class
]
FAIL_ON_WARNINGS = True

View File

@ -56,6 +56,30 @@ mozilla::RefPtr<VideoSessionConduit> VideoSessionConduit::Create(VideoSessionCon
return obj;
}
WebrtcVideoConduit::WebrtcVideoConduit():
mOtherDirection(nullptr),
mShutDown(false),
mVideoEngine(nullptr),
mTransport(nullptr),
mRenderer(nullptr),
mPtrExtCapture(nullptr),
mEngineTransmitting(false),
mEngineReceiving(false),
mChannel(-1),
mCapId(-1),
mCurSendCodecConfig(nullptr),
mSendingWidth(0),
mSendingHeight(0),
mReceivingWidth(640),
mReceivingHeight(480),
mVideoLatencyTestEnable(false),
mVideoLatencyAvg(0),
mMinBitrate(200),
mStartBitrate(300),
mMaxBitrate(2000)
{
}
WebrtcVideoConduit::~WebrtcVideoConduit()
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");

View File

@ -221,31 +221,8 @@ public:
return 0;
}
WebrtcVideoConduit():
mOtherDirection(nullptr),
mShutDown(false),
mVideoEngine(nullptr),
mTransport(nullptr),
mRenderer(nullptr),
mPtrExtCapture(nullptr),
mEngineTransmitting(false),
mEngineReceiving(false),
mChannel(-1),
mCapId(-1),
mCurSendCodecConfig(nullptr),
mSendingWidth(0),
mSendingHeight(0),
mReceivingWidth(640),
mReceivingHeight(480),
mVideoLatencyTestEnable(false),
mVideoLatencyAvg(0),
mMinBitrate(200),
mStartBitrate(300),
mMaxBitrate(2000)
{
}
virtual ~WebrtcVideoConduit() ;
WebrtcVideoConduit();
virtual ~WebrtcVideoConduit();
MediaConduitErrorCode Init(WebrtcVideoConduit *other);