Bug 914294 - Don't throw exceptions from the history result end batch macro to retain backwards compatibility.
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 15 Oct 2013 14:30:33 +0200
changeset 164648 55e9f80315a634ae2353dd552974cdd7087b6be3
parent 164647 344307c027959e537e5d669f1d85f33a57097135
child 164649 50abdc9ee4054f9743f1b9ba185921eaf8fc8c46
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs914294
milestone27.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 914294 - Don't throw exceptions from the history result end batch macro to retain backwards compatibility. r=mano
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)