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 { class VolatileBufferPtr_base {
public: public:
explicit VolatileBufferPtr_base(VolatileBuffer* vbuf) : mVBuf(vbuf) { explicit VolatileBufferPtr_base(VolatileBuffer* vbuf)
: mVBuf(vbuf)
, mMapping(nullptr)
, mPurged(false)
{
Lock(); Lock();
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -21,7 +21,8 @@ namespace storage {
//// StatementParams //// StatementParams
StatementParams::StatementParams(mozIStorageStatement *aStatement) : StatementParams::StatementParams(mozIStorageStatement *aStatement) :
mStatement(aStatement) mStatement(aStatement),
mParamCount(0)
{ {
NS_ASSERTION(mStatement != nullptr, "mStatement is null"); NS_ASSERTION(mStatement != nullptr, "mStatement is null");
(void)mStatement->GetParameterCount(&mParamCount); (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. // we only copy the strings at save time, so to take multiple parameters we'd need to copy them then.
SamplerStackFramePrintfRAII(const char *aInfo, SamplerStackFramePrintfRAII(const char *aInfo,
js::ProfileEntry::Category aCategory, uint32_t line, const char *aFormat, ...) js::ProfileEntry::Category aCategory, uint32_t line, const char *aFormat, ...)
: mHandle(nullptr)
{ {
if (profiler_is_active() && !profiler_in_privacy_mode()) { if (profiler_is_active() && !profiler_in_privacy_mode()) {
va_list args; va_list args;

View file

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

View file

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

View file

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

View file

@ -74,6 +74,11 @@ private:
protected: protected:
WidgetMouseEventBase() WidgetMouseEventBase()
: button(0)
, buttons(0)
, pressure(0)
, hitCluster(false)
, inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE)
{ {
} }
@ -195,6 +200,9 @@ public:
protected: protected:
WidgetMouseEvent() WidgetMouseEvent()
: acceptActivation(false)
, ignoreRootScrollFrame(false)
, clickCount(0)
{ {
} }
@ -316,6 +324,8 @@ private:
friend class mozilla::dom::PBrowserChild; friend class mozilla::dom::PBrowserChild;
protected: protected:
WidgetDragEvent() WidgetDragEvent()
: userCancelled(false)
, mDefaultPreventedOnContent(false)
{ {
} }
public: public:
@ -373,6 +383,8 @@ class WidgetMouseScrollEvent : public WidgetMouseEventBase
{ {
private: private:
WidgetMouseScrollEvent() WidgetMouseScrollEvent()
: delta(0)
, isHorizontal(false)
{ {
} }
@ -436,6 +448,20 @@ private:
friend class mozilla::dom::PBrowserChild; friend class mozilla::dom::PBrowserChild;
WidgetWheelEvent() 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; friend class mozilla::dom::PBrowserChild;
WidgetPointerEvent() 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); static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
ScreenProxy::ScreenProxy(nsScreenManagerProxy* aScreenManager, ScreenDetails aDetails) ScreenProxy::ScreenProxy(nsScreenManagerProxy* aScreenManager, ScreenDetails aDetails)
: mScreenManager(aScreenManager) : mContentsScaleFactor(0)
, mScreenManager(aScreenManager)
, mId(0)
, mPixelDepth(0)
, mColorDepth(0)
, mCacheValid(false) , mCacheValid(false)
, mCacheWillInvalidate(false) , mCacheWillInvalidate(false)
{ {

View file

@ -82,6 +82,20 @@ private:
protected: protected:
WidgetKeyboardEvent() 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; friend class dom::PBrowserChild;
WidgetQueryContentEvent() WidgetQueryContentEvent()
: mSucceeded(false)
, mUseNativeLineBreak(true)
, mWithFontRanges(false)
{ {
MOZ_CRASH("WidgetQueryContentEvent is created without proper arguments"); MOZ_CRASH("WidgetQueryContentEvent is created without proper arguments");
} }
@ -650,6 +667,7 @@ private:
, mReversed(false) , mReversed(false)
, mExpandToClusterBoundary(true) , mExpandToClusterBoundary(true)
, mSucceeded(false) , mSucceeded(false)
, mUseNativeLineBreak(true)
{ {
} }

View file

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

View file

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