From 9438ec2f1aa3b84312d1a7aac0efda97cef86e2c Mon Sep 17 00:00:00 2001 From: Farmer Tseng Date: Wed, 29 Mar 2017 13:43:44 +0800 Subject: [PATCH] Bug 1351190 - Associate printing actor with SystemGroup r=bevistseng,smaug MozReview-Commit-ID: VNLEKCFrtX --HG-- extra : rebase_source : 7b2fdc5bae4fcac61a03c37ec9056f47f6566b57 --- dom/ipc/ContentChild.cpp | 14 ++++++++------ .../components/printingui/ipc/nsPrintingProxy.cpp | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index b9e06da7c4d4..73859c07ffb6 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -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 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 printingProxy = nsPrintingProxy::GetInstance(); -#endif - SetProcessName(NS_LITERAL_STRING("Web Content"), true); return true; diff --git a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp index 353be04eea64..aa39439d75f6 100644 --- a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp +++ b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp @@ -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; }