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 250200 93c5dec5ad4b
parent 250199 87bba928e233
child 250201 74fe432c68e8
push id4521
push usercpearce@mozilla.com
push date2015-03-04 01:22 +0000
treeherdermozilla-beta@8abdbdecd2d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);
 }