Bug 1470771: Follow-up: Fix null deref in Windows GPU process. r=me

This commit is contained in:
Kris Maglione 2018-06-30 16:37:51 -07:00
parent 84cc9de89a
commit 55220193dd

View File

@ -212,7 +212,10 @@ public:
if (mMapFile.isSome()) {
return mMapSize;
}
return mStringMap->MapSize();
if (mStringMap) {
return mStringMap->MapSize();
}
return 0;
}
bool Initialized() const { return mStringMap || mMapFile.isSome(); }
@ -388,16 +391,13 @@ nsStringBundleBase::CollectReports(nsIHandleReportCallback* aHandleReport,
size_t heapSize = SizeOfIncludingThis(MallocSizeOf);
nsAutoCStringN<256> path("explicit/string-bundles/");
{
RefPtr<SharedStringBundle> shared = do_QueryObject(this);
if (shared) {
path.AppendLiteral("SharedStringBundle");
if (XRE_IsParentProcess()) {
sharedSize = shared->MapSize();
}
} else {
path.AppendLiteral("nsStringBundle");
if (RefPtr<SharedStringBundle> shared = do_QueryObject(this)) {
path.AppendLiteral("SharedStringBundle");
if (XRE_IsParentProcess()) {
sharedSize = shared->MapSize();
}
} else {
path.AppendLiteral("nsStringBundle");
}
path.AppendLiteral("(url=\"");