Bug 1279998 - Remove NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS. r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Mon, 01 Aug 2016 11:16:19 -0700
changeset 395005 cd11e79ae64455a36717d07104844692604f3fa0
parent 394995 ffac2798999c5b84f1b4605a1280994bb665a406
child 526932 8d8437518b0637a73c3573629a1c46766928a33a
push id24700
push userbmo:continuation@gmail.com
push dateMon, 01 Aug 2016 18:17:10 +0000
reviewersfroydnj
bugs1279998
milestone51.0a1
Bug 1279998 - Remove NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS. r=froydnj MozReview-Commit-ID: LbT6922qlHQ
xpcom/glue/nsCOMPtr.cpp
xpcom/glue/nsCOMPtr.h
--- a/xpcom/glue/nsCOMPtr.cpp
+++ b/xpcom/glue/nsCOMPtr.cpp
@@ -7,37 +7,29 @@
 #include "nsCOMPtr.h"
 
 nsresult
 nsQueryInterface::operator()(const nsIID& aIID, void** aAnswer) const
 {
   nsresult status;
   if (mRawPtr) {
     status = mRawPtr->QueryInterface(aIID, aAnswer);
-#ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
-    NS_ASSERTION(NS_SUCCEEDED(status),
-                 "interface not found---were you expecting that?");
-#endif
   } else {
     status = NS_ERROR_NULL_POINTER;
   }
 
   return status;
 }
 
 nsresult
 nsQueryInterfaceWithError::operator()(const nsIID& aIID, void** aAnswer) const
 {
   nsresult status;
   if (mRawPtr) {
     status = mRawPtr->QueryInterface(aIID, aAnswer);
-#ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
-    NS_ASSERTION(NS_SUCCEEDED(status),
-                 "interface not found---were you expecting that?");
-#endif
   } else {
     status = NS_ERROR_NULL_POINTER;
   }
 
   if (mErrorPtr) {
     *mErrorPtr = status;
   }
   return status;
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -51,17 +51,16 @@
   #pragma warning( disable: 4514 )
 #endif
 
 #define NSCAP_FEATURE_USE_BASE
 
 #ifdef DEBUG
   #define NSCAP_FEATURE_TEST_DONTQUERY_CASES
   #undef NSCAP_FEATURE_USE_BASE
-//#define NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
 #endif
 
 #ifdef __GNUC__
   // Our use of nsCOMPtr_base::mRawPtr violates the C++ standard's aliasing
   // rules. Mark it with the may_alias attribute so that gcc 3.3 and higher
   // don't reorder instructions based on aliasing assumptions for
   // this variable.  Fortunately, gcc versions < 3.3 do not do any
   // optimizations that break nsCOMPtr.