Backed out changeset 1c2bd3bdebd6 (bug 933378)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Sat, 16 Jul 2016 10:03:10 +0200
changeset 305133 8d50699deac13afab27328b99b8ec4ed2a2c5f59
parent 305132 4a25ec78baeb22a3a2f1861eb40d05a97dc5702c
child 305134 c907a44b0c6c820bd0f83fe43f68134734fa67fd
push id79506
push usercbook@mozilla.com
push dateSat, 16 Jul 2016 08:03:37 +0000
treeherdermozilla-inbound@d12f1688d471 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs933378
milestone50.0a1
backs out1c2bd3bdebd6999903d931a22c3ae42120baf5f2
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 1c2bd3bdebd6 (bug 933378)
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
dom/bindings/ErrorResult.h
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2006,22 +2006,16 @@ private:
                     "Offset of mLength should match");
       static_assert(offsetof(FakeString, mFlags) ==
                       offsetof(StringAsserter, mFlags),
                     "Offset of mFlags should match");
     }
   };
 };
 
-class FastErrorResult :
-    public mozilla::binding_danger::TErrorResult<
-      mozilla::binding_danger::JustAssertCleanupPolicy>
-{
-};
-
 } // namespace binding_detail
 
 enum StringificationBehavior {
   eStringify,
   eEmpty,
   eNull
 };
 
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -5256,32 +5256,32 @@ def getJSToNativeConversionInfo(type, de
                     globalObj = js::GetGlobalForObjectCrossCompartment(unwrappedVal);
                     """,
                     sourceDescription=sourceDescription)
             else:
                 getPromiseGlobal = ""
 
             templateBody = fill(
                 """
-                { // Scope for our GlobalObject, FastErrorResult, JSAutoCompartment,
+                { // Scope for our GlobalObject, ErrorResult, JSAutoCompartment,
                   // etc.
 
                   JS::Rooted<JSObject*> globalObj(cx, JS::CurrentGlobalOrNull(cx));
                   $*{getPromiseGlobal}
                   JSAutoCompartment ac(cx, globalObj);
                   GlobalObject promiseGlobal(cx, globalObj);
                   if (promiseGlobal.Failed()) {
                     $*{exceptionCode}
                   }
 
                   JS::Rooted<JS::Value> valueToResolve(cx, $${val});
                   if (!JS_WrapValue(cx, &valueToResolve)) {
                     $*{exceptionCode}
                   }
-                  binding_detail::FastErrorResult promiseRv;
+                  ErrorResult promiseRv;
                 #ifdef SPIDERMONKEY_PROMISE
                   nsCOMPtr<nsIGlobalObject> global =
                     do_QueryInterface(promiseGlobal.GetAsSupports());
                   if (!global) {
                     promiseRv.Throw(NS_ERROR_UNEXPECTED);
                     promiseRv.MaybeSetPendingException(cx);
                     $*{exceptionCode}
                   }
@@ -6966,17 +6966,17 @@ class CGCallGenerator(CGThing):
         elif result is not None:
             assert resultOutParam is None
             call = CGWrapper(call, pre=resultVar + " = ")
 
         call = CGWrapper(call, post=";\n")
         self.cgRoot.append(call)
 
         if isFallible:
-            self.cgRoot.prepend(CGGeneric("binding_detail::FastErrorResult rv;\n"))
+            self.cgRoot.prepend(CGGeneric("ErrorResult rv;\n"))
             self.cgRoot.append(CGGeneric(dedent(
                 """
                 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
                   return false;
                 }
                 """)))
 
         self.cgRoot.append(CGGeneric("MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"))
@@ -8481,17 +8481,17 @@ class CGEnumerateHook(CGAbstractBindingM
         # Our "self" is actually the "obj" argument in this case, not the thisval.
         CGAbstractBindingMethod.__init__(
             self, descriptor, ENUMERATE_HOOK_NAME,
             args, getThisObj="", callArgs="")
 
     def generate_code(self):
         return CGGeneric(dedent("""
             AutoTArray<nsString, 8> names;
-            binding_detail::FastErrorResult rv;
+            ErrorResult rv;
             self->GetOwnPropertyNames(cx, names, rv);
             if (rv.MaybeSetPendingException(cx)) {
               return false;
             }
             bool dummy;
             for (uint32_t i = 0; i < names.Length(); ++i) {
               if (!JS_HasUCProperty(cx, obj, names[i].get(), names[i].Length(), &dummy)) {
                 return false;
@@ -10574,17 +10574,17 @@ class CGEnumerateOwnPropertiesViaGetOwnP
         CGAbstractBindingMethod.__init__(self, descriptor,
                                          "EnumerateOwnPropertiesViaGetOwnPropertyNames",
                                          args, getThisObj="",
                                          callArgs="")
 
     def generate_code(self):
         return CGGeneric(dedent("""
             AutoTArray<nsString, 8> names;
-            binding_detail::FastErrorResult rv;
+            ErrorResult rv;
             self->GetOwnPropertyNames(cx, names, rv);
             if (rv.MaybeSetPendingException(cx)) {
               return false;
             }
             // OK to pass null as "proxy" because it's ignored if
             // shadowPrototypeProperties is true
             return AppendNamedPropertyIds(cx, nullptr, names, true, props);
             """))
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -146,18 +146,16 @@ public:
   TErrorResult& operator=(TErrorResult&& aRHS);
 
   explicit TErrorResult(nsresult aRv)
     : TErrorResult()
   {
     AssignErrorCode(aRv);
   }
 
-  operator ErrorResult&();
-
   void Throw(nsresult rv) {
     MOZ_ASSERT(NS_FAILED(rv), "Please don't try throwing success");
     AssignErrorCode(rv);
   }
 
   // Duplicate our current state on the given TErrorResult object.  Any
   // existing errors or messages on the target will be suppressed before
   // cloning.  Our own error state remains unchanged.
@@ -494,23 +492,16 @@ public:
 
 private:
   // Not to be implemented, to make sure people always pass this by
   // reference, not by value.
   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<JustAssertCleanupPolicy>*>(this));
-}
-
 // A class for use when an ErrorResult should just automatically be ignored.
 class IgnoredErrorResult : public ErrorResult
 {
 public:
   ~IgnoredErrorResult()
   {
     SuppressException();
   }