Bug 1519284. Fix rooting hazards in PaymentRequest. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D16891

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2019-01-18 09:18:18 +00:00
parent 220c6752d7
commit 3bf84b1452
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#include "mozilla/dom/PaymentRequest.h"
#include "mozilla/dom/PaymentRequestChild.h"
#include "mozilla/dom/PaymentRequestManager.h"
#include "mozilla/dom/RootedDictionary.h"
#include "mozilla/intl/LocaleService.h"
#include "mozilla/intl/MozLocale.h"
#include "mozilla/EventStateManager.h"
@ -1080,7 +1081,7 @@ void PaymentRequest::ResolvedCallback(JSContext* aCx,
}
// Converting value to a PaymentDetailsUpdate dictionary
PaymentDetailsUpdate details;
RootedDictionary<PaymentDetailsUpdate> details(aCx);
if (!details.Init(aCx, aValue)) {
AbortUpdate(NS_ERROR_DOM_TYPE_ERR);
JS_ClearPendingException(aCx);

View File

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/PaymentRequestUpdateEvent.h"
#include "mozilla/dom/RootedDictionary.h"
namespace mozilla {
namespace dom {
@ -61,7 +62,7 @@ void PaymentRequestUpdateEvent::ResolvedCallback(JSContext* aCx,
}
// Converting value to a PaymentDetailsUpdate dictionary
PaymentDetailsUpdate details;
RootedDictionary<PaymentDetailsUpdate> details(aCx);
if (!details.Init(aCx, aValue)) {
mRequest->AbortUpdate(NS_ERROR_TYPE_ERR);
JS_ClearPendingException(aCx);