Bug 1231378 - part 4 - Fix uninitialized members of classes in netwerk/widget/storage/uriloader/memory/tools, r=smaug

This commit is contained in:
Andrea Marchesini 2016-01-12 18:16:59 +00:00
parent fa1db4f4b7
commit caa2f9b456
19 changed files with 88 additions and 4 deletions

View file

@ -88,7 +88,11 @@ private:
class VolatileBufferPtr_base {
public:
explicit VolatileBufferPtr_base(VolatileBuffer* vbuf) : mVBuf(vbuf) {
explicit VolatileBufferPtr_base(VolatileBuffer* vbuf)
: mVBuf(vbuf)
, mMapping(nullptr)
, mPurged(false)
{
Lock();
}

View file

@ -43,6 +43,7 @@ NS_IMPL_ISUPPORTS(ChildDNSService,
ChildDNSService::ChildDNSService()
: mFirstTime(true)
, mOffline(false)
, mDisablePrefetch(false)
, mPendingRequestsLock("DNSPendingRequestsLock")
{
MOZ_ASSERT(IsNeckoChild());

View file

@ -261,6 +261,9 @@ NetAddrElement::~NetAddrElement()
AddrInfo::AddrInfo(const char *host, const PRAddrInfo *prAddrInfo,
bool disableIPv4, bool filterNameCollision, const char *cname)
: mHostName(nullptr)
, mCanonicalName(nullptr)
, ttl(NO_TTL_DATA)
{
MOZ_ASSERT(prAddrInfo, "Cannot construct AddrInfo with a null prAddrInfo pointer!");
const uint32_t nameCollisionAddr = htonl(0x7f003535); // 127.0.53.53
@ -281,6 +284,9 @@ AddrInfo::AddrInfo(const char *host, const PRAddrInfo *prAddrInfo,
}
AddrInfo::AddrInfo(const char *host, const char *cname)
: mHostName(nullptr)
, mCanonicalName(nullptr)
, ttl(NO_TTL_DATA)
{
Init(host, cname);
}

View file

@ -20,7 +20,8 @@ namespace mozilla {
namespace net {
DNSRequestParent::DNSRequestParent()
: mIPCClosed(false)
: mFlags(0)
, mIPCClosed(false)
{
}

View file

@ -480,8 +480,12 @@ private:
nsDNSService::nsDNSService()
: mLock("nsDNSServer.mLock")
, mDisableIPv6(false)
, mDisablePrefetch(false)
, mFirstTime(true)
, mOffline(false)
, mNotifyResolution(false)
, mOfflineLocalhost(false)
{
}

View file

@ -132,6 +132,8 @@ void nsIDNService::prefsChanged(nsIPrefBranch *prefBranch, const char16_t *pref)
}
nsIDNService::nsIDNService()
: mShowPunycode(false)
, mIDNUseWhitelist(false)
{
#ifdef IDNA2008
uint32_t IDNAOptions = UIDNA_CHECK_BIDI | UIDNA_CHECK_CONTEXTJ;

View file

@ -108,6 +108,7 @@ BindingParams::BindingParams(mozIStorageBindingParamsArray *aOwningArray,
: mLocked(false)
, mOwningArray(aOwningArray)
, mOwningStatement(aOwningStatement)
, mParamCount(0)
{
(void)mOwningStatement->GetParameterCount(&mParamCount);
mParameters.SetCapacity(mParamCount);

View file

@ -24,6 +24,8 @@ public:
NS_DECL_MOZISTORAGEROW
NS_DECL_MOZISTORAGEVALUEARRAY
Row() : mNumCols(0) {}
/**
* Initializes the object with the given statement. Copies the values from
* the statement.

View file

@ -44,6 +44,7 @@ public:
NS_PRECONDITION(mStatementOwner, "Must have a statement owner!");
}
StatementData()
: mStatement(nullptr)
{
}
~StatementData()

View file

@ -21,7 +21,8 @@ namespace storage {
//// StatementParams
StatementParams::StatementParams(mozIStorageStatement *aStatement) :
mStatement(aStatement)
mStatement(aStatement),
mParamCount(0)
{
NS_ASSERTION(mStatement != nullptr, "mStatement is null");
(void)mStatement->GetParameterCount(&mParamCount);

View file

@ -432,6 +432,7 @@ public:
// we only copy the strings at save time, so to take multiple parameters we'd need to copy them then.
SamplerStackFramePrintfRAII(const char *aInfo,
js::ProfileEntry::Category aCategory, uint32_t line, const char *aFormat, ...)
: mHandle(nullptr)
{
if (profiler_is_active() && !profiler_in_privacy_mode()) {
va_list args;

View file

@ -76,6 +76,7 @@ NS_IMPL_RELEASE(OfflineCacheUpdateChild)
OfflineCacheUpdateChild::OfflineCacheUpdateChild(nsIDOMWindow* aWindow)
: mState(STATE_UNINITIALIZED)
, mIsUpgrade(false)
, mSucceeded(false)
, mAppID(NECKO_NO_APP_ID)
, mInBrowser(false)
, mWindow(aWindow)

View file

@ -687,6 +687,7 @@ nsOfflineManifestItem::nsOfflineManifestItem(nsIURI *aURI,
nsIApplicationCache::ITEM_MANIFEST)
, mParserState(PARSE_INIT)
, mNeedsUpdate(true)
, mStrictFileOriginPolicy(false)
, mManifestHashInitialized(false)
{
ReadStrictFileOriginPolicyPref();
@ -1168,6 +1169,7 @@ nsOfflineCacheUpdate::nsOfflineCacheUpdate()
, mRescheduleCount(0)
, mPinnedEntryRetriesCount(0)
, mPinned(false)
, mByteProgress(0)
{
}

View file

@ -190,6 +190,7 @@ protected:
}
WidgetEvent()
: time(0)
{
MOZ_COUNT_CTOR(WidgetEvent);
}
@ -570,6 +571,7 @@ protected:
}
WidgetInputEvent()
: modifiers(0)
{
}

View file

@ -74,6 +74,11 @@ private:
protected:
WidgetMouseEventBase()
: button(0)
, buttons(0)
, pressure(0)
, hitCluster(false)
, inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE)
{
}
@ -195,6 +200,9 @@ public:
protected:
WidgetMouseEvent()
: acceptActivation(false)
, ignoreRootScrollFrame(false)
, clickCount(0)
{
}
@ -316,6 +324,8 @@ private:
friend class mozilla::dom::PBrowserChild;
protected:
WidgetDragEvent()
: userCancelled(false)
, mDefaultPreventedOnContent(false)
{
}
public:
@ -373,6 +383,8 @@ class WidgetMouseScrollEvent : public WidgetMouseEventBase
{
private:
WidgetMouseScrollEvent()
: delta(0)
, isHorizontal(false)
{
}
@ -436,6 +448,20 @@ private:
friend class mozilla::dom::PBrowserChild;
WidgetWheelEvent()
: deltaX(0.0)
, deltaY(0.0)
, deltaZ(0.0)
, deltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
, customizedByUserPrefs(false)
, isMomentum(false)
, mIsNoLineOrPageDelta(false)
, lineOrPageDeltaX(0)
, lineOrPageDeltaY(0)
, scrollType(SCROLL_DEFAULT)
, overflowDeltaX(0.0)
, overflowDeltaY(0.0)
, mViewPortIsOverscrolled(false)
, mCanTriggerSwipe(false)
{
}
@ -605,6 +631,9 @@ class WidgetPointerEvent : public WidgetMouseEvent
friend class mozilla::dom::PBrowserChild;
WidgetPointerEvent()
: width(0)
, height(0)
, isPrimary(true)
{
}

View file

@ -20,7 +20,11 @@ using namespace mozilla::dom;
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
ScreenProxy::ScreenProxy(nsScreenManagerProxy* aScreenManager, ScreenDetails aDetails)
: mScreenManager(aScreenManager)
: mContentsScaleFactor(0)
, mScreenManager(aScreenManager)
, mId(0)
, mPixelDepth(0)
, mColorDepth(0)
, mCacheValid(false)
, mCacheWillInvalidate(false)
{

View file

@ -82,6 +82,20 @@ private:
protected:
WidgetKeyboardEvent()
: keyCode(0)
, charCode(0)
, location(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
, isChar(false)
, mIsRepeat(false)
, mIsComposing(false)
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
, mNativeKeyEvent(nullptr)
, mUniqueId(0)
#ifdef XP_MACOSX
, mNativeKeyCode(0)
, mNativeModifierFlags(0)
#endif
{
}
@ -470,6 +484,9 @@ private:
friend class dom::PBrowserChild;
WidgetQueryContentEvent()
: mSucceeded(false)
, mUseNativeLineBreak(true)
, mWithFontRanges(false)
{
MOZ_CRASH("WidgetQueryContentEvent is created without proper arguments");
}
@ -650,6 +667,7 @@ private:
, mReversed(false)
, mExpandToClusterBoundary(true)
, mSucceeded(false)
, mUseNativeLineBreak(true)
{
}

View file

@ -16,6 +16,7 @@ using namespace mozilla::dom;
NS_IMPL_ISUPPORTS(nsFilePickerProxy, nsIFilePicker)
nsFilePickerProxy::nsFilePickerProxy()
: mSelectedType(0)
{
}

View file

@ -62,9 +62,12 @@ XRemoteClient::XRemoteClient()
mInitialized = false;
mMozVersionAtom = 0;
mMozLockAtom = 0;
mMozCommandLineAtom = 0;
mMozResponseAtom = 0;
mMozWMStateAtom = 0;
mMozUserAtom = 0;
mMozProfileAtom = 0;
mMozProgramAtom = 0;
mLockData = 0;
if (!sRemoteLm)
sRemoteLm = PR_NewLogModule("XRemoteClient");