Backed out changeset ed38780a242c (bug 933378)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Sat, 16 Jul 2016 10:03:08 +0200
changeset 345235 a795d0003a443bf30b7d0b169d0913aee4b46ade
parent 345234 9852c943ba72527613e3b4245247a50f51f3959a
child 345236 4a25ec78baeb22a3a2f1861eb40d05a97dc5702c
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs933378
milestone50.0a1
backs outed38780a242cb738c331a9abaf63b94ae325d325
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
Backed out changeset ed38780a242c (bug 933378)
dom/bindings/BindingUtils.cpp
dom/bindings/ErrorResult.h
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -574,18 +574,16 @@ TErrorResult<CleanupPolicy>::NoteJSConte
   if (JS_IsExceptionPending(aCx)) {
     mResult = NS_ERROR_DOM_EXCEPTION_ON_JSCONTEXT;
   } else {
     mResult = NS_ERROR_UNCATCHABLE_EXCEPTION;
   }
 }
 
 template class TErrorResult<JustAssertCleanupPolicy>;
-template class TErrorResult<AssertAndSuppressCleanupPolicy>;
-template class TErrorResult<JustSuppressCleanupPolicy>;
 
 } // namespace binding_danger
 
 namespace dom {
 
 bool
 DefineConstants(JSContext* cx, JS::Handle<JSObject*> obj,
                 const ConstantSpec* cs)
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -455,34 +455,23 @@ private:
   void operator=(const TErrorResult&) = delete;
 };
 
 struct JustAssertCleanupPolicy {
   static const bool assertHandled = true;
   static const bool suppress = false;
 };
 
-struct AssertAndSuppressCleanupPolicy {
-  static const bool assertHandled = true;
-  static const bool suppress = true;
-};
-
-struct JustSuppressCleanupPolicy {
-  static const bool assertHandled = false;
-  static const bool suppress = true;
-};
-
 } // namespace binding_danger
 
 // A class people should normally use on the stack when they plan to actually
 // do something with the exception.
-class ErrorResult :
-    public binding_danger::TErrorResult<binding_danger::AssertAndSuppressCleanupPolicy>
+class ErrorResult : public binding_danger::TErrorResult<binding_danger::JustAssertCleanupPolicy>
 {
-  typedef binding_danger::TErrorResult<binding_danger::AssertAndSuppressCleanupPolicy> BaseErrorResult;
+  typedef binding_danger::TErrorResult<binding_danger::JustAssertCleanupPolicy> BaseErrorResult;
 
 public:
   ErrorResult()
     : BaseErrorResult()
   {}
 
   ErrorResult(ErrorResult&& aRHS)
     : BaseErrorResult(Move(aRHS))
@@ -509,25 +498,27 @@ private:
   ErrorResult(const ErrorResult&) = delete;
   void operator=(const ErrorResult&) = delete;
 };
 
 template<typename CleanupPolicy>
 binding_danger::TErrorResult<CleanupPolicy>::operator ErrorResult&()
 {
   return *static_cast<ErrorResult*>(
-     reinterpret_cast<TErrorResult<AssertAndSuppressCleanupPolicy>*>(this));
+     reinterpret_cast<TErrorResult<JustAssertCleanupPolicy>*>(this));
 }
 
 // A class for use when an ErrorResult should just automatically be ignored.
-// This doesn't inherit from ErrorResult so we don't make two separate calls to
-// SuppressException.
-class IgnoredErrorResult :
-    public binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy>
+class IgnoredErrorResult : public ErrorResult
 {
+public:
+  ~IgnoredErrorResult()
+  {
+    SuppressException();
+  }
 };
 
 /******************************************************************************
  ** Macros for checking results
  ******************************************************************************/
 
 #define ENSURE_SUCCESS(res, ret)                                          \
   do {                                                                    \