mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Bug 1451376 - Properly enforce single PrintingParent per content process. r=jld, a=RyanVM
--HG-- extra : source : 6e0fe40d8a55a986a26844393853722824918ffe extra : intermediate-source : 8364f4c4f877f5edfb03ddf1304840b9f2cf7b11
This commit is contained in:
parent
4f0786ab02
commit
6395d4600f
1 changed files with 11 additions and 4 deletions
|
|
@ -3224,11 +3224,15 @@ PPrintingParent*
|
|||
ContentParent::AllocPPrintingParent()
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
MOZ_ASSERT(!mPrintingParent,
|
||||
"Only one PrintingParent should be created per process.");
|
||||
MOZ_RELEASE_ASSERT(!mPrintingParent,
|
||||
"Only one PrintingParent should be created per process.");
|
||||
|
||||
// Create the printing singleton for this process.
|
||||
mPrintingParent = new PrintingParent();
|
||||
|
||||
// Take another reference for IPDL code.
|
||||
mPrintingParent.get()->AddRef();
|
||||
|
||||
return mPrintingParent.get();
|
||||
#else
|
||||
MOZ_ASSERT_UNREACHABLE("Should never be created if no printing.");
|
||||
|
|
@ -3240,8 +3244,11 @@ bool
|
|||
ContentParent::DeallocPPrintingParent(PPrintingParent* printing)
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
MOZ_ASSERT(mPrintingParent == printing,
|
||||
"Only one PrintingParent should have been created per process.");
|
||||
MOZ_RELEASE_ASSERT(mPrintingParent == printing,
|
||||
"Only one PrintingParent should have been created per process.");
|
||||
|
||||
// Release reference taken for IPDL code.
|
||||
static_cast<PrintingParent*>(printing)->Release();
|
||||
|
||||
mPrintingParent = nullptr;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue