зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1451376: Properly enforce single PrintingParent per content process. r=jld
This commit is contained in:
Родитель
59bd7c58a9
Коммит
e2dd0c27f0
|
@ -3408,11 +3408,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.");
|
||||
|
@ -3424,8 +3428,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
|
||||
|
|
Загрузка…
Ссылка в новой задаче