Bug 1279998 - Remove NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS. r=froydnj
MozReview-Commit-ID: LbT6922qlHQ
--- 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.