Bug 933378 part 3. Fix the ErrorResult usage in PeerConnectionImpl to not use ErrorResult directly anymore. r=jib
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 15 Jul 2016 22:35:13 -0400
changeset 305220 6cdae42eaa8913955a1458c92e1ed3cd97a8d1e6
parent 305219 a3834c6ce6d7fac2787923d7efb1da443fe785eb
child 305221 5d9f5afda58e2f7b06d1f221d191889666378ef0
push id30455
push usercbook@mozilla.com
push dateSun, 17 Jul 2016 08:08:29 +0000
treeherdermozilla-central@711963e8daa3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs933378
milestone50.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 933378 part 3. Fix the ErrorResult usage in PeerConnectionImpl to not use ErrorResult directly anymore. r=jib
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -133,17 +133,25 @@ using namespace mozilla::dom;
 
 typedef PCObserverString ObString;
 
 static const char* logTag = "PeerConnectionImpl";
 
 
 // Getting exceptions back down from PCObserver is generally not harmful.
 namespace {
-class JSErrorResult : public ErrorResult
+// This is a terrible hack.  The problem is that SuppressException is not
+// inline, and we link this file without libxul in some cases (e.g. for our test
+// setup).  So we can't use ErrorResult or IgnoredErrorResult because those call
+// SuppressException...  And we can't use FastErrorResult because we can't
+// include BindingUtils.h, because our linking is completely fucked up.  Use
+// BaseErrorResult directly.  Please do not let me see _anyone_ doing this
+// without really careful review from someone who knows what they are doing.
+class JSErrorResult :
+    public binding_danger::TErrorResult<binding_danger::JustAssertCleanupPolicy>
 {
 public:
   ~JSErrorResult()
   {
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
     SuppressException();
 #endif
   }
@@ -164,16 +172,17 @@ public:
   WrappableJSErrorResult() : isCopy(false) {}
   WrappableJSErrorResult(const WrappableJSErrorResult &other) : mRv(), isCopy(true) {}
   ~WrappableJSErrorResult() {
     if (isCopy) {
       MOZ_ASSERT(NS_IsMainThread());
     }
   }
   operator JSErrorResult &() { return mRv; }
+  operator ErrorResult &() { return mRv; }
 private:
   JSErrorResult mRv;
   bool isCopy;
 };
 }
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
 static nsresult InitNSSInContent()