mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1156742 Part 11: Allow RemotePrintJobChild to abort the print. r=roc
This is so the RemotePrintJobParent can abort the printing in the child when something goes wrong.
This commit is contained in:
parent
61d3769790
commit
3641b4f559
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsPagePrintTimer.h"
|
||||
#include "nsPrintEngine.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layout {
|
||||
@ -29,8 +30,10 @@ RemotePrintJobChild::RecvPageProcessed()
|
||||
bool
|
||||
RemotePrintJobChild::RecvAbortPrint(const nsresult& aRv)
|
||||
{
|
||||
NS_NOTREACHED("RemotePrintJobChild::RecvAbortPrint not implemented!");
|
||||
return false;
|
||||
MOZ_ASSERT(mPrintEngine);
|
||||
|
||||
mPrintEngine->CleanupOnFailure(aRv, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
@ -50,6 +53,14 @@ RemotePrintJobChild::SetPagePrintTimer(nsPagePrintTimer* aPagePrintTimer)
|
||||
mPagePrintTimer = aPagePrintTimer;
|
||||
}
|
||||
|
||||
void
|
||||
RemotePrintJobChild::SetPrintEngine(nsPrintEngine* aPrintEngine)
|
||||
{
|
||||
MOZ_ASSERT(aPrintEngine);
|
||||
|
||||
mPrintEngine = aPrintEngine;
|
||||
}
|
||||
|
||||
RemotePrintJobChild::~RemotePrintJobChild()
|
||||
{
|
||||
MOZ_COUNT_DTOR(RemotePrintJobChild);
|
||||
@ -59,6 +70,7 @@ void
|
||||
RemotePrintJobChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
mPagePrintTimer = nullptr;
|
||||
mPrintEngine = nullptr;
|
||||
}
|
||||
|
||||
} // namespace layout
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
class nsPagePrintTimer;
|
||||
class nsPrintEngine;
|
||||
|
||||
namespace mozilla {
|
||||
namespace layout {
|
||||
@ -33,10 +34,13 @@ public:
|
||||
|
||||
void SetPagePrintTimer(nsPagePrintTimer* aPagePrintTimer);
|
||||
|
||||
void SetPrintEngine(nsPrintEngine* aPrintEngine);
|
||||
|
||||
private:
|
||||
~RemotePrintJobChild() final;
|
||||
|
||||
RefPtr<nsPagePrintTimer> mPagePrintTimer;
|
||||
RefPtr<nsPrintEngine> mPrintEngine;
|
||||
};
|
||||
|
||||
} // namespace layout
|
||||
|
@ -3491,6 +3491,7 @@ nsPrintEngine::StartPagePrintTimer(nsPrintObject* aPO)
|
||||
printSession->GetRemotePrintJob(getter_AddRefs(remotePrintJob));
|
||||
if (NS_SUCCEEDED(rv) && remotePrintJob) {
|
||||
remotePrintJob->SetPagePrintTimer(mPagePrintTimer);
|
||||
remotePrintJob->SetPrintEngine(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user