Bug 1557687. Remove nsPrintData::mDocWasToBeDestroyed. r=bobowen

This shows that this variable has never been read going back all the way to
the original Mercurial import in 2007:

  hg grep -f --diff mDocWasToBeDestroyed layout/printing/ns*

Differential Revision: https://phabricator.services.mozilla.com/D34143

--HG--
extra : rebase_source : c14a51dab1825e26fb8031d291d2c69e78931c84
extra : amend_source : 73794b07d703987db8d2eb49dd97d74b1a9be325
This commit is contained in:
Jonathan Watt 2019-05-29 10:42:14 +01:00
Родитель e360889d62
Коммит 913d6b76ee
4 изменённых файлов: 4 добавлений и 21 удалений

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

@ -33,7 +33,6 @@ nsPrintData::nsPrintData(ePrintDataType aType)
mOnStartSent(false),
mIsAborted(false),
mPreparingForPrint(false),
mDocWasToBeDestroyed(false),
mShrinkToFit(false),
mNumPrintablePages(0),
mNumPagesPrinted(0),

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

@ -31,13 +31,6 @@ class PrintPreviewUserEventSuppressor;
// mPreparingForPrint - indicates that we have started Printing but
// have not gone to the timer to start printing the pages. It gets turned
// off right before we go to the timer.
//
// mDocWasToBeDestroyed - Gets set when "someone" tries to unload the document
// while we were prparing to Print. This typically happens if a user starts
// to print while a page is still loading. If they start printing and pause
// at the print dialog and then the page comes in, we then abort printing
// because the document is no longer stable.
//
//------------------------------------------------------------------------
class nsPrintData {
typedef mozilla::PrintPreviewUserEventSuppressor
@ -79,7 +72,6 @@ class nsPrintData {
bool mOnStartSent;
bool mIsAborted; // tells us the document is being aborted
bool mPreparingForPrint; // see comments above
bool mDocWasToBeDestroyed; // see comments above
bool mShrinkToFit;
int32_t mNumPrintablePages;
int32_t mNumPagesPrinted;

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

@ -630,15 +630,6 @@ nsresult nsPrintJob::Initialize(nsIDocumentViewerPrint* aDocViewerPrint,
return NS_OK;
}
//-------------------------------------------------------
bool nsPrintJob::CheckBeforeDestroy() {
if (mPrt && mPrt->mPreparingForPrint) {
mPrt->mDocWasToBeDestroyed = true;
return true;
}
return false;
}
//-------------------------------------------------------
nsresult nsPrintJob::Cancel() {
if (mPrt && mPrt->mPrintSettings) {

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

@ -208,7 +208,8 @@ class nsPrintJob final : public nsIObserver,
nsAString& aTitle, nsAString& aURLStr,
eDocTitleDefault aDefType);
bool CheckBeforeDestroy();
bool CheckBeforeDestroy() const { return mPrt && mPrt->mPreparingForPrint; }
nsresult Cancel();
mozilla::PresShell* GetPrintPreviewPresShell() {