Bug 868130 - Use an AutoSafeJSContext in nsObjectLoadingContent::TeardownProtoChain. r=gabor
authorBobby Holley <bobbyholley@gmail.com>
Wed, 22 May 2013 10:05:24 -0600
changeset 133011 fe05e84ac7a0dafa045dfb5f4365cfba19d74fe7
parent 133010 a90a8cda180586d2ddd3b32bcad80c8dfb51a742
child 133012 71a10dfafaad4afc79499153933e25e130bfbdb8
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersgabor
bugs868130
milestone24.0a1
Bug 868130 - Use an AutoSafeJSContext in nsObjectLoadingContent::TeardownProtoChain. r=gabor
content/base/src/nsObjectLoadingContent.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -3093,17 +3093,17 @@ nsObjectLoadingContent::GetPluginJSObjec
 void
 nsObjectLoadingContent::TeardownProtoChain()
 {
   nsCOMPtr<nsIContent> thisContent =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
 
   // Use the safe JSContext here as we're not always able to find the
   // JSContext associated with the NPP any more.
-  JSContext *cx = nsContentUtils::GetSafeJSContext();
+  AutoSafeJSContext cx;
   JS::Rooted<JSObject*> obj(cx, thisContent->GetWrapper());
   NS_ENSURE_TRUE(obj, /* void */);
 
   JS::Rooted<JSObject*> proto(cx);
   JSAutoRequest ar(cx);
   JSAutoCompartment ac(cx, obj);
 
   // Loop over the DOM element's JS object prototype chain and remove