зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1430682 - Use OwningNonNull for nsPagePrintTimer::mDocViewerPrint and remove null checks. r=bobowen
MozReview-Commit-ID: 5CPaYTA2PrC
This commit is contained in:
Родитель
706256a2cc
Коммит
e04dd6678d
|
@ -140,24 +140,22 @@ nsPagePrintTimer::Notify(nsITimer *timer)
|
|||
}
|
||||
}
|
||||
|
||||
if (mDocViewerPrint) {
|
||||
bool donePrePrint = true;
|
||||
// Don't start to pre-print if we're waiting on the parent still.
|
||||
if (mPrintJob && !mWaitingForRemotePrint) {
|
||||
donePrePrint = mPrintJob->PrePrintPage();
|
||||
}
|
||||
|
||||
if (donePrePrint && !mWaitingForRemotePrint) {
|
||||
StopWatchDogTimer();
|
||||
// Pass nullptr here since name already was set in constructor.
|
||||
mDocument->Dispatch(TaskCategory::Other, do_AddRef(this));
|
||||
} else {
|
||||
// Start the watch dog if we're waiting for preprint to ensure that if any
|
||||
// mozPrintCallbacks take to long we error out.
|
||||
StartWatchDogTimer();
|
||||
}
|
||||
|
||||
bool donePrePrint = true;
|
||||
// Don't start to pre-print if we're waiting on the parent still.
|
||||
if (mPrintJob && !mWaitingForRemotePrint) {
|
||||
donePrePrint = mPrintJob->PrePrintPage();
|
||||
}
|
||||
|
||||
if (donePrePrint && !mWaitingForRemotePrint) {
|
||||
StopWatchDogTimer();
|
||||
// Pass nullptr here since name already was set in constructor.
|
||||
mDocument->Dispatch(TaskCategory::Other, do_AddRef(this));
|
||||
} else {
|
||||
// Start the watch dog if we're waiting for preprint to ensure that if any
|
||||
// mozPrintCallbacks take to long we error out.
|
||||
StartWatchDogTimer();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "nsIDocumentViewerPrint.h"
|
||||
#include "nsPrintObject.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/OwningNonNull.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
class nsPrintJob;
|
||||
|
@ -33,7 +34,7 @@ public:
|
|||
uint32_t aDelay)
|
||||
: Runnable("nsPagePrintTimer")
|
||||
, mPrintJob(aPrintJob)
|
||||
, mDocViewerPrint(aDocViewerPrint)
|
||||
, mDocViewerPrint(*aDocViewerPrint)
|
||||
, mDocument(aDocument)
|
||||
, mDelay(aDelay)
|
||||
, mFiringCount(0)
|
||||
|
@ -41,7 +42,7 @@ public:
|
|||
, mWatchDogCount(0)
|
||||
, mDone(false)
|
||||
{
|
||||
MOZ_ASSERT(aDocument);
|
||||
MOZ_ASSERT(aDocViewerPrint && aDocument);
|
||||
mDocViewerPrint->IncrementDestroyBlockedCount();
|
||||
}
|
||||
|
||||
|
@ -71,7 +72,7 @@ private:
|
|||
void Fail();
|
||||
|
||||
nsPrintJob* mPrintJob;
|
||||
nsCOMPtr<nsIDocumentViewerPrint> mDocViewerPrint;
|
||||
const mozilla::OwningNonNull<nsIDocumentViewerPrint> mDocViewerPrint;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
nsCOMPtr<nsITimer> mWatchDogTimer;
|
||||
|
|
Загрузка…
Ссылка в новой задаче