Bug 1129722 - Add {Hold,Drop}JSObjects to MediaKeyStatusMap - r=jwwang,bz a=lmandel
authorEdwin Flores <eflores@mozilla.com>
Fri, 06 Feb 2015 11:04:47 +1300
changeset 249075 93c5dec5ad4b66e4fe50db8062e8f212272aa375
parent 249074 87bba928e23365135fea8c8679bb0058c84b98aa
child 249076 74fe432c68e869dfda4dbcf7446d9775008b977f
push id970
push userjryans@gmail.com
push dateTue, 10 Mar 2015 15:54:18 +0000
reviewersjwwang, bz, lmandel
bugs1129722
milestone37.0
Bug 1129722 - Add {Hold,Drop}JSObjects to MediaKeyStatusMap - r=jwwang,bz a=lmandel
dom/media/eme/MediaKeyStatusMap.cpp
--- a/dom/media/eme/MediaKeyStatusMap.cpp
+++ b/dom/media/eme/MediaKeyStatusMap.cpp
@@ -42,20 +42,23 @@ MediaKeyStatusMap::MediaKeyStatusMap(JSC
                                      ErrorResult& aRv)
   : mParent(aParent)
   , mUpdateError(NS_OK)
 {
   mMap = JS::NewMapObject(aCx);
   if (NS_WARN_IF(!mMap)) {
     aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
   }
+
+  mozilla::HoldJSObjects(this);
 }
 
 MediaKeyStatusMap::~MediaKeyStatusMap()
 {
+  mozilla::DropJSObjects(this);
 }
 
 JSObject*
 MediaKeyStatusMap::WrapObject(JSContext* aCx)
 {
   return MediaKeyStatusMapBinding::Wrap(aCx, this);
 }