Bug 851895 - Don't assert against a failure in CanCallNow. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Thu, 21 Mar 2013 08:20:46 -0700
changeset 125823 b2391af8fecb4f421536cf31f7494b5dc60996c9
parent 125822 d4dbfc5c23a3bc36b10fdfecfc497ef5303b6b31
child 125824 1653ada4e2510d587ea005551848fec7f6a87e78
push id24464
push useremorley@mozilla.com
push dateFri, 22 Mar 2013 14:00:12 +0000
treeherdermozilla-central@3825fdbcec62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs851895
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 851895 - Don't assert against a failure in CanCallNow. r=mrbkap This can definitely happen now if the |this| object is wrong. It's possible that we should be checking this earlier, but as the code stands this assertion is incorrect.
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -2205,21 +2205,16 @@ XPCWrappedNative::CallMethod(XPCCallCont
                              CallMode mode /*= CALL_METHOD */)
 {
     XPCContext* xpcc = ccx.GetXPCContext();
     NS_ASSERTION(xpcc->CallerTypeIsJavaScript(),
                  "Native caller for XPCWrappedNative::CallMethod?");
 
     nsresult rv = ccx.CanCallNow();
     if (NS_FAILED(rv)) {
-        // If the security manager is complaining then this is not really an
-        // internal error in xpconnect. So, no reason to botch the assertion.
-        NS_ASSERTION(rv == NS_ERROR_XPC_SECURITY_MANAGER_VETO,
-                     "hmm? CanCallNow failed in XPCWrappedNative::CallMethod. "
-                     "We are finding out about this late!");
         return Throw(rv, ccx);
     }
 
     DEBUG_TrackWrapperCall(ccx.GetWrapper(), mode);
 
     // set up the method index and do the security check if needed
 
     uint32_t secFlag;