Skip to content

Commit

Permalink
Bug 1231378 - part 4 - Fix uninitialized members of classes in netwer…
Browse files Browse the repository at this point in the history
…k/widget/storage/uriloader/memory/tools, r=smaug
  • Loading branch information
bakulf committed Jan 12, 2016
1 parent 71abb1e commit 1461ee4
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 4 deletions.
6 changes: 5 additions & 1 deletion memory/volatile/VolatileBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ class VolatileBuffer

class VolatileBufferPtr_base {
public:
explicit VolatileBufferPtr_base(VolatileBuffer* vbuf) : mVBuf(vbuf) {
explicit VolatileBufferPtr_base(VolatileBuffer* vbuf)
: mVBuf(vbuf)
, mMapping(nullptr)
, mPurged(false)
{
Lock();
}

Expand Down
1 change: 1 addition & 0 deletions netwerk/dns/ChildDNSService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ NS_IMPL_ISUPPORTS(ChildDNSService,
ChildDNSService::ChildDNSService()
: mFirstTime(true)
, mOffline(false)
, mDisablePrefetch(false)
, mPendingRequestsLock("DNSPendingRequestsLock")
{
MOZ_ASSERT(IsNeckoChild());
Expand Down
6 changes: 6 additions & 0 deletions netwerk/dns/DNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion netwerk/dns/DNSRequestParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace mozilla {
namespace net {

DNSRequestParent::DNSRequestParent()
: mIPCClosed(false)
: mFlags(0)
, mIPCClosed(false)
{

}
Expand Down
4 changes: 4 additions & 0 deletions netwerk/dns/nsDNSService2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,12 @@ class NotifyDNSResolution: public nsRunnable

nsDNSService::nsDNSService()
: mLock("nsDNSServer.mLock")
, mDisableIPv6(false)
, mDisablePrefetch(false)
, mFirstTime(true)
, mOffline(false)
, mNotifyResolution(false)
, mOfflineLocalhost(false)
{
}

Expand Down
2 changes: 2 additions & 0 deletions netwerk/dns/nsIDNService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions storage/mozStorageBindingParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ BindingParams::BindingParams(mozIStorageBindingParamsArray *aOwningArray,
: mLocked(false)
, mOwningArray(aOwningArray)
, mOwningStatement(aOwningStatement)
, mParamCount(0)
{
(void)mOwningStatement->GetParameterCount(&mParamCount);
mParameters.SetCapacity(mParamCount);
Expand Down
2 changes: 2 additions & 0 deletions storage/mozStorageRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Row final : public mozIStorageRow
NS_DECL_MOZISTORAGEROW
NS_DECL_MOZISTORAGEVALUEARRAY

Row() : mNumCols(0) {}

/**
* Initializes the object with the given statement. Copies the values from
* the statement.
Expand Down
1 change: 1 addition & 0 deletions storage/mozStorageStatementData.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class StatementData
NS_PRECONDITION(mStatementOwner, "Must have a statement owner!");
}
StatementData()
: mStatement(nullptr)
{
}
~StatementData()
Expand Down
3 changes: 2 additions & 1 deletion storage/mozStorageStatementParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions tools/profiler/public/GeckoProfilerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ class MOZ_STACK_CLASS SamplerStackFramePrintfRAII {
// 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;
Expand Down
1 change: 1 addition & 0 deletions uriloader/prefetch/OfflineCacheUpdateChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions uriloader/prefetch/nsOfflineCacheUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ nsOfflineManifestItem::nsOfflineManifestItem(nsIURI *aURI,
nsIApplicationCache::ITEM_MANIFEST)
, mParserState(PARSE_INIT)
, mNeedsUpdate(true)
, mStrictFileOriginPolicy(false)
, mManifestHashInitialized(false)
{
ReadStrictFileOriginPolicyPref();
Expand Down Expand Up @@ -1168,6 +1169,7 @@ nsOfflineCacheUpdate::nsOfflineCacheUpdate()
, mRescheduleCount(0)
, mPinnedEntryRetriesCount(0)
, mPinned(false)
, mByteProgress(0)
{
}

Expand Down
2 changes: 2 additions & 0 deletions widget/BasicEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class WidgetEvent
}

WidgetEvent()
: time(0)
{
MOZ_COUNT_CTOR(WidgetEvent);
}
Expand Down Expand Up @@ -570,6 +571,7 @@ class WidgetInputEvent : public WidgetGUIEvent
}

WidgetInputEvent()
: modifiers(0)
{
}

Expand Down
29 changes: 29 additions & 0 deletions widget/MouseEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class WidgetMouseEventBase : public WidgetInputEvent

protected:
WidgetMouseEventBase()
: button(0)
, buttons(0)
, pressure(0)
, hitCluster(false)
, inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE)
{
}

Expand Down Expand Up @@ -195,6 +200,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, public WidgetPointerHelper

protected:
WidgetMouseEvent()
: acceptActivation(false)
, ignoreRootScrollFrame(false)
, clickCount(0)
{
}

Expand Down Expand Up @@ -316,6 +324,8 @@ class WidgetDragEvent : public WidgetMouseEvent
friend class mozilla::dom::PBrowserChild;
protected:
WidgetDragEvent()
: userCancelled(false)
, mDefaultPreventedOnContent(false)
{
}
public:
Expand Down Expand Up @@ -373,6 +383,8 @@ class WidgetMouseScrollEvent : public WidgetMouseEventBase
{
private:
WidgetMouseScrollEvent()
: delta(0)
, isHorizontal(false)
{
}

Expand Down Expand Up @@ -436,6 +448,20 @@ class WidgetWheelEvent : public WidgetMouseEventBase
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)
{
}

Expand Down Expand Up @@ -605,6 +631,9 @@ class WidgetPointerEvent : public WidgetMouseEvent
friend class mozilla::dom::PBrowserChild;

WidgetPointerEvent()
: width(0)
, height(0)
, isPrimary(true)
{
}

Expand Down
6 changes: 5 additions & 1 deletion widget/ScreenProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
18 changes: 18 additions & 0 deletions widget/TextEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ class WidgetKeyboardEvent : public WidgetInputEvent

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
{
}

Expand Down Expand Up @@ -470,6 +484,9 @@ class WidgetQueryContentEvent : public WidgetGUIEvent
friend class dom::PBrowserChild;

WidgetQueryContentEvent()
: mSucceeded(false)
, mUseNativeLineBreak(true)
, mWithFontRanges(false)
{
MOZ_CRASH("WidgetQueryContentEvent is created without proper arguments");
}
Expand Down Expand Up @@ -650,6 +667,7 @@ class WidgetSelectionEvent : public WidgetGUIEvent
, mReversed(false)
, mExpandToClusterBoundary(true)
, mSucceeded(false)
, mUseNativeLineBreak(true)
{
}

Expand Down
1 change: 1 addition & 0 deletions widget/nsFilePickerProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ using namespace mozilla::dom;
NS_IMPL_ISUPPORTS(nsFilePickerProxy, nsIFilePicker)

nsFilePickerProxy::nsFilePickerProxy()
: mSelectedType(0)
{
}

Expand Down
3 changes: 3 additions & 0 deletions widget/xremoteclient/XRemoteClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1461ee4

Please sign in to comment.