Backed out changeset cc92635ec29a (bug 1225219) for build bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 18 Nov 2015 09:52:19 -0800
changeset 309804 6d9cf8dd2ed88a09ed3b6861117f64908938dc76
parent 309803 4656964dbed41a499bb9d59e09aea36d7eeafbad
child 309805 4a9ebc74d62a0b07a026a54631b15c21660a3933
push id7649
push usermartin.thomson@gmail.com
push dateThu, 19 Nov 2015 00:06:17 +0000
bugs1225219
milestone45.0a1
backs outcc92635ec29acf9e11d2527127492fe48d88239b
Backed out changeset cc92635ec29a (bug 1225219) for build bustage CLOSED TREE
dom/bindings/BindingUtils.cpp
dom/bindings/ErrorResult.h
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -462,46 +462,16 @@ ErrorResult::operator=(ErrorResult&& aRH
   // Note: It's important to do this last, since this affects the condition
   // checks above!
   mResult = aRHS.mResult;
   aRHS.mResult = NS_OK;
   return *this;
 }
 
 void
-ErrorResult::CloneTo(ErrorResult& aRv) const
-{
-  aRv.ClearUnionData();
-  aRv.mResult = mResult;
-  aRv.mMightHaveUnreportedJSException = mMightHaveUnreportedJSException;
-
-  if (IsErrorWithMessage()) {
-#ifdef DEBUG
-    aRv.mUnionState = HasMessage;
-#endif
-    aRv.mMessage = new Message();
-    aRv.mMessage->mArgs = mMessage->mArgs;
-    aRv.mMessage->mErrorNumber = mMessage->mErrorNumber;
-  } else if (IsDOMException()) {
-#ifdef DEBUG
-    aRv.mUnionState = HasDOMExceptionInfo;
-#endif
-    aRv.mDOMExceptionInfo = new DOMExceptionInfo(mDOMExceptionInfo->mRv,
-                                                 mDOMExceptionInfo->mMessage);
-  } else if (IsJSException()) {
-#ifdef DEBUG
-    aRv.mUnionState = HasJSException;
-#endif
-    JSContext* cx = nsContentUtils::RootingCxForThread();
-    JS::Rooted<JS::Value> exception(cx, mJSException);
-    aRv.ThrowJSException(cx, exception);
-  }
-}
-
-void
 ErrorResult::SuppressException()
 {
   WouldReportJSException();
   ClearUnionData();
   // We don't use AssignErrorCode, because we want to override existing error
   // states, which AssignErrorCode is not allowed to do.
   mResult = NS_OK;
 }
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -110,21 +110,16 @@ public:
     AssignErrorCode(aRv);
   }
 
   void Throw(nsresult rv) {
     MOZ_ASSERT(NS_FAILED(rv), "Please don't try throwing success");
     AssignErrorCode(rv);
   }
 
-  // Duplicate our current state on the given ErrorResult object.  Any existing
-  // errors or messages on the target will be suppressed before cloning.  Our
-  // own error state remains unchanged.
-  void CloneTo(ErrorResult& aRv) const;
-
   // Use SuppressException when you want to suppress any exception that might be
   // on the ErrorResult.  After this call, the ErrorResult will be back a "no
   // exception thrown" state.
   void SuppressException();
 
   // Use StealNSResult() when you want to safely convert the ErrorResult to an
   // nsresult that you will then return to a caller.  This will
   // SuppressException(), since there will no longer be a way to report it.