Bug 1224664 followup: NS_ASSERT_OWNINGTHREAD needs to be #ifdef DEBUG if our NS_DECL_OWNINGTHREAD is.
☠☠ backed out by 9852c943ba72 ☠ ☠
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 15 Jul 2016 23:40:19 -0400
changeset 330258 7fef388bc6cf208be8015f654bb0415118cda6b3
parent 330257 ed38780a242cb738c331a9abaf63b94ae325d325
child 330259 6d6a147955f35e2838c0dd10ee98b5bafef15b1b
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1224664
milestone50.0a1
Bug 1224664 followup: NS_ASSERT_OWNINGTHREAD needs to be #ifdef DEBUG if our NS_DECL_OWNINGTHREAD is.
dom/bindings/ErrorResult.h
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -114,17 +114,17 @@ public:
 #ifdef DEBUG
     , mMightHaveUnreportedJSException(false)
     , mUnionState(HasNothing)
 #endif
   {
   }
 
   ~TErrorResult() {
-    NS_ASSERT_OWNINGTHREAD(TErrorResult);
+    AssertInOwningThread();
 
     if (CleanupPolicy::assertHandled) {
       // Consumers should have called one of MaybeSetPendingException
       // (possibly via ToJSValue), StealNSResult, and SuppressException
       AssertReportedOrSuppressed();
     }
 
     if (CleanupPolicy::suppress) {
@@ -361,18 +361,20 @@ private:
     uint16_t argCount = dom::GetErrorArgCount(errorNumber);
     dom::StringArrayAppender::Append(messageArgsArray, argCount,
                                      Forward<Ts>(messageArgs)...);
 #ifdef DEBUG
     mUnionState = HasMessage;
 #endif // DEBUG
   }
 
-  void AssertInOwningThread() const {
+  MOZ_ALWAYS_INLINE void AssertInOwningThread() const {
+#ifdef DEBUG
     NS_ASSERT_OWNINGTHREAD(TErrorResult);
+#endif
   }
 
   void AssignErrorCode(nsresult aRv) {
     MOZ_ASSERT(aRv != NS_ERROR_TYPE_ERR, "Use ThrowTypeError()");
     MOZ_ASSERT(aRv != NS_ERROR_RANGE_ERR, "Use ThrowRangeError()");
     MOZ_ASSERT(!IsErrorWithMessage(), "Don't overwrite errors with message");
     MOZ_ASSERT(aRv != NS_ERROR_DOM_JS_EXCEPTION, "Use ThrowJSException()");
     MOZ_ASSERT(!IsJSException(), "Don't overwrite JS exceptions");