Bug 1281702: Report the actual error message, rather than a generic one from the graphics logger. r?mchang draft
authorMilan Sreckovic <milan@mozilla.com>
Mon, 18 Jul 2016 16:35:35 -0400
changeset 389242 a5fe6954a2edaac9b564d39728a4532c8c336441
parent 389110 69a9474a32061e0afc22ad93f0683934cff0c531
child 525688 4e9dd739d2d9643a0010b4c746158784152de4c2
push id23332
push usermsreckovic@mozilla.com
push dateMon, 18 Jul 2016 20:36:03 +0000
reviewersmchang
bugs1281702
milestone50.0a1
Bug 1281702: Report the actual error message, rather than a generic one from the graphics logger. r?mchang MozReview-Commit-ID: BT4FjWJ03wF
gfx/2d/Logging.h
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -496,19 +496,24 @@ private:
       }
       mMessage << "]: ";
     }
   }
 
   void WriteLog(const std::string &aString) {
     if (MOZ_UNLIKELY(LogIt())) {
       Logger::OutputMessage(aString, L, NoNewline());
+      // Assert if required.  We don't have a three parameter MOZ_ASSERT
+      // so use the underlying functions instead (see bug 1281702):
+#ifdef DEBUG
       if (mOptions & int(LogOptions::AssertOnCall)) {
-        MOZ_ASSERT(false, "An assert from the graphics logger");
+        MOZ_ReportAssertionFailure(aString.c_str(), __FILE__, __LINE__);
+        MOZ_CRASH("GFX: An assert from the graphics logger");
       }
+#endif
       if ((mOptions & int(LogOptions::CrashAction)) && ValidReason()) {
         Logger::CrashAction(mReason);
       }
     }
   }
 
   std::stringstream mMessage;
   int mOptions;