Bug 914294 - Don't throw exceptions from the history result end batch macro to retain backwards compatibility. r=mano, a=lsblakk
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 15 Oct 2013 14:30:33 +0200
changeset 160766 2718af9506b3b25f01ccfc9bd209935ce91a3a46
parent 160765 eaea6570492ffd1d8792a3f314e0b56838401bc4
child 160767 a62b94423cacb3c6875f0b6efeeb2a402d60a8cb
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmano, lsblakk
bugs914294
milestone26.0a2
Bug 914294 - Don't throw exceptions from the history result end batch macro to retain backwards compatibility. r=mano, a=lsblakk
toolkit/components/places/nsNavHistoryResult.cpp
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -56,18 +56,18 @@
 // is executed. This ensures a Refresh() is executed before proceeding, if a
 // batch is ongoing.
 // Note that there's no point in using this in node getters, since after a
 // batch the node would be replaced by a new one, so it would hand out outdated
 // information regardless.
 #define END_RESULT_BATCH_AND_REFRESH_CONTENTS() \
   PR_BEGIN_MACRO \
   nsNavHistoryResult* result = GetResult(); \
-  NS_ENSURE_STATE(result); \
-  if (result->mBatchInProgress) { \
+  NS_WARN_IF_FALSE(result, "Working with a non-live-updating Places container"); \
+  if (result && result->mBatchInProgress) { \
     result->EndBatch(); \
   } \
   PR_END_MACRO
 
 // Emulate string comparison (used for sorting) for PRTime and int.
 inline int32_t ComparePRTime(PRTime a, PRTime b)
 {
   if (a < b)