Bug 832385 - don't spam WARNING when there's no XPConnect. r=smaug a=tef+
☠☠ backed out by 324b933aec07 ☠ ☠
authorAndrew McCreight <amccreight@mozilla.com>
Thu, 24 Jan 2013 09:36:56 -0800
changeset 118303 92259dfdcbd60050de75e3caa12e0f065aa59c7d
parent 118302 3f59ebb61ca9ec2ca2aba5663817bf29c43afecc
child 118304 324b933aec074ad27e110f151201e670bcfcb1a7
push id340
push useramccreight@mozilla.com
push dateThu, 24 Jan 2013 17:38:13 +0000
reviewerssmaug, tef
bugs832385
milestone18.0
Bug 832385 - don't spam WARNING when there's no XPConnect. r=smaug a=tef+
content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -4585,17 +4585,19 @@ nsContentUtils::HoldJSObjects(void* aScr
 
   return NS_OK;
 }
 
 /* static */
 nsresult
 nsContentUtils::DropJSObjects(void* aScriptObjectHolder)
 {
-  NS_ENSURE_TRUE(sXPConnect, NS_ERROR_UNEXPECTED);
+  if (NS_UNLIKELY(!sXPConnect)) {
+    return NS_ERROR_UNEXPECTED;
+  }
 
   NS_LOG_RELEASE(sXPConnect, sJSGCThingRootCount - 1, "HoldJSObjects");
   nsresult rv = sXPConnect->RemoveJSHolder(aScriptObjectHolder);
   if (--sJSGCThingRootCount == 0) {
     nsLayoutStatics::Release();
   }
   return rv;
 }