Update RTC_DCHECK_IS_ON checks in SdpOfferAnswerHandler

...and OperationsChain.

Bug: none
Change-Id: Iac07db38deb02fda0a9194b73755cd329def8e98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186840
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32327}
diff --git a/rtc_base/operations_chain.h b/rtc_base/operations_chain.h
index a3768dd..a7252d4 100644
--- a/rtc_base/operations_chain.h
+++ b/rtc_base/operations_chain.h
@@ -51,11 +51,15 @@
       : functor_(std::forward<FunctorT>(functor)),
         callback_(std::move(callback)) {}
 
-  ~OperationWithFunctor() override { RTC_DCHECK(has_run_); }
+  ~OperationWithFunctor() override {
+#if RTC_DCHECK_IS_ON
+    RTC_DCHECK(has_run_);
+#endif  // RTC_DCHECK_IS_ON
+  }
 
   void Run() override {
+#if RTC_DCHECK_IS_ON
     RTC_DCHECK(!has_run_);
-#ifdef RTC_DCHECK_IS_ON
     has_run_ = true;
 #endif  // RTC_DCHECK_IS_ON
     // The functor being executed may invoke the callback synchronously,
@@ -71,7 +75,7 @@
  private:
   typename std::remove_reference<FunctorT>::type functor_;
   std::function<void()> callback_;
-#ifdef RTC_DCHECK_IS_ON
+#if RTC_DCHECK_IS_ON
   bool has_run_ = false;
 #endif  // RTC_DCHECK_IS_ON
 };
@@ -168,7 +172,7 @@
 
    private:
     scoped_refptr<OperationsChain> operations_chain_;
-#ifdef RTC_DCHECK_IS_ON
+#if RTC_DCHECK_IS_ON
     bool has_run_ = false;
 #endif  // RTC_DCHECK_IS_ON