Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument(). draft
authorcku <cku@mozilla.com>
Mon, 18 Sep 2017 23:55:54 +0800
changeset 668142 534d52841c5b6abb64859ecd4a4645659f64381b
parent 668141 d62efd8e9a54d10e14ab93ec7312c4a132cc6f59
child 668204 1370423866d0f9ac60a72b871a8a0c12405a5db5
push id80936
push usercku@mozilla.com
push dateThu, 21 Sep 2017 04:54:21 +0000
bugs1401069
milestone57.0a1
Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument(). 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);
   }