Bug 1351190 - Associate printing actor with SystemGroup r=bevistseng,smaug

MozReview-Commit-ID: VNLEKCFrtX

--HG--
extra : rebase_source : 7b2fdc5bae4fcac61a03c37ec9056f47f6566b57
This commit is contained in:
Farmer Tseng 2017-03-29 13:43:44 +08:00
Родитель 5d653db212
Коммит 9438ec2f1a
2 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -521,6 +521,14 @@ ContentChild::RecvSetXPCOMProcessAttributes(const XPCOMInitData& aXPCOMInit,
mLookAndFeelCache = aLookAndFeelIntCache;
InitXPCOM(aXPCOMInit, aInitialData);
InitGraphicsDeviceData(aXPCOMInit.contentDeviceData());
#ifdef NS_PRINTING
// Force the creation of the nsPrintingProxy so that it's IPC counterpart,
// PrintingParent, is always available for printing initiated from the parent.
// Create nsPrintingProxy instance later than the SystemGroup initialization.
RefPtr<nsPrintingProxy> printingProxy = nsPrintingProxy::GetInstance();
#endif
return IPC_OK();
}
@ -602,12 +610,6 @@ ContentChild::Init(MessageLoop* aIOLoop,
mID = aChildID;
mIsForBrowser = aIsForBrowser;
#ifdef NS_PRINTING
// Force the creation of the nsPrintingProxy so that it's IPC counterpart,
// PrintingParent, is always available for printing initiated from the parent.
RefPtr<nsPrintingProxy> printingProxy = nsPrintingProxy::GetInstance();
#endif
SetProcessName(NS_LITERAL_STRING("Web Content"), true);
return true;

Просмотреть файл

@ -63,6 +63,10 @@ nsPrintingProxy::GetInstance()
nsresult
nsPrintingProxy::Init()
{
ContentChild::GetSingleton()->SetEventTargetForActor(this,
SystemGroup::EventTargetFor(mozilla::TaskCategory::Other));
MOZ_ASSERT(this->GetActorEventTarget());
mozilla::Unused << ContentChild::GetSingleton()->SendPPrintingConstructor(this);
return NS_OK;
}