DELETE: 1 patches - promise-nsresult
authorNikhil Marathe <nsm.nikhil@gmail.com>
Wed, 23 Jul 2014 17:33:56 -0700
changeset 1116 af55728bd88e3fafcda4aea08268fa5a25294656
parent 1115 1fe757dfd53e1355931e584bd047388fd8e4a9d2
child 1117 813230c769c67f7310d8cc5b41c222879820bc8e
push id32
push usernsm.nikhil@gmail.com
push dateThu, 24 Jul 2014 00:32:46 +0000
DELETE: 1 patches - promise-nsresult DELETE: promise-nsresult qparent: 666e5e6b3abf qtip: 666e5e6b3abf top: (none)
promise-nsresult
series
deleted file mode 100644
--- a/promise-nsresult
+++ /dev/null
@@ -1,84 +0,0 @@
-# HG changeset patch
-# Parent bb4dd9872236bfd9a2238b731f7e98081811ebbd
-# User Nikhil Marathe <nsm.nikhil@gmail.com>
-
-diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp
---- a/dom/promise/Promise.cpp
-+++ b/dom/promise/Promise.cpp
-@@ -2,16 +2,17 @@
- /* vim: set ts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
-  * You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #include "mozilla/dom/Promise.h"
- 
- #include "jsfriendapi.h"
-+#include "mozilla/dom/DOMError.h"
- #include "mozilla/dom/OwningNonNull.h"
- #include "mozilla/dom/PromiseBinding.h"
- #include "mozilla/CycleCollectedJSRuntime.h"
- #include "mozilla/Preferences.h"
- #include "PromiseCallback.h"
- #include "PromiseNativeHandler.h"
- #include "nsContentUtils.h"
- #include "WorkerPrivate.h"
-@@ -1117,16 +1118,31 @@ Promise::ArgumentToJSValue(const nsAStri
-   if (sharedBuffer) {
-     NS_ADDREF(sharedBuffer);
-   }
- 
-   return true;
- }
- 
- bool
-+Promise::ArgumentToJSValue(const nsresult& aResult,
-+                           JSContext* aCx,
-+                           JSObject* aScope,
-+                           JS::MutableHandle<JS::Value> aValue)
-+{
-+  nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(GetParentObject());
-+  if (NS_WARN_IF(!window)) {
-+    // FIXME(nsm): How to set an error on cx?
-+    return false;
-+  }
-+
-+  nsRefPtr<DOMError> domError = new DOMError(window, aResult);
-+  return ArgumentToJSValue(domError, aCx, aScope, aValue);
-+}
-+bool
- Promise::ArgumentToJSValue(bool aArgument,
-                            JSContext* aCx,
-                            JSObject* aScope,
-                            JS::MutableHandle<JS::Value> aValue)
- {
-   aValue.setBoolean(aArgument);
-   return true;
- }
-diff --git a/dom/promise/Promise.h b/dom/promise/Promise.h
---- a/dom/promise/Promise.h
-+++ b/dom/promise/Promise.h
-@@ -216,16 +216,23 @@ private:
- 
-   // Accept booleans.
-   bool
-   ArgumentToJSValue(bool aArgument,
-                     JSContext* aCx,
-                     JSObject* aScope,
-                     JS::MutableHandle<JS::Value> aValue);
- 
-+  // Accepts nsresult and creates a DOMError.
-+  bool
-+  ArgumentToJSValue(const nsresult& aResult,
-+                    JSContext* aCx,
-+                    JSObject* aScope,
-+                    JS::MutableHandle<JS::Value> aValue);
-+
-   // Accept objects that inherit from nsWrapperCache and nsISupports (e.g. most
-   // DOM objects).
-   template <class T>
-   typename EnableIf<IsBaseOf<nsWrapperCache, T>::value &&
-                     IsBaseOf<nsISupports, T>::value, bool>::Type
-   ArgumentToJSValue(T& aArgument,
-                     JSContext* aCx,
-                     JSObject* aScope,
--- a/series
+++ b/series
@@ -12,11 +12,10 @@ 903441-navigation-event
 903441-setup-request
 903441-intercepts
 903441-sw-nointercept
 foo
 898524-cache
 sw-install-tests2
 sw-more-install-tests
 943704-importscripts
-promise-nsresult
 984048-swutil-fetcher
 984048-swm-update+