Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument(). r=fatseng
authorcku <cku@mozilla.com>
Mon, 18 Sep 2017 23:55:54 +0800
changeset 431685 3e576101b9d37f6ee8188af441b62adde57d65e6
parent 431684 5e23e6f7d6d50d34b89157515c7246baec3c867e
child 431686 870ce315712c4484f69ebe14fdc21f826c674d3f
push id7785
push userryanvm@gmail.com
push dateThu, 21 Sep 2017 13:39:55 +0000
treeherdermozilla-beta@06d4034a8a03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfatseng
bugs1401069
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument(). r=fatseng MozReview-Commit-ID: 74UkMV3ZOWm
widget/windows/PDFViaEMFPrintHelper.cpp
--- a/widget/windows/PDFViaEMFPrintHelper.cpp
+++ b/widget/windows/PDFViaEMFPrintHelper.cpp
@@ -32,18 +32,21 @@ PDFViaEMFPrintHelper::~PDFViaEMFPrintHel
 {
   CloseDocument();
 }
 
 nsresult
 PDFViaEMFPrintHelper::OpenDocument(nsIFile *aFile)
 {
   MOZ_ASSERT(aFile);
+
   if (mPDFDoc) {
-    MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time");
+    MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time,"
+                           "Use CloseDocument() to close the opened file"
+                           "before calling OpenDocument()");
     return NS_ERROR_FAILURE;
   }
 
   if (!mPDFiumEngine) {
     mPDFiumEngine = PDFiumEngineShim::GetInstanceOrNull();
     NS_ENSURE_TRUE(mPDFiumEngine, NS_ERROR_FAILURE);
   }