Bug 1275999 part 5. Get rid of GetDefaultScopeFromJSContext. r=bholley
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 27 May 2016 09:53:33 -0400
changeset 338344 ce020eaf0e1e350ada9aea1c0922cd2d475f3cf6
parent 338343 8cab033c0e0b01536bdc1e85fa7fd0f798219165
child 338345 50002d03a5717bcbbb6b9775e966f30d7d560af8
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1275999
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1275999 part 5. Get rid of GetDefaultScopeFromJSContext. r=bholley
dom/base/nsDOMJSUtils.h
dom/base/nsJSUtils.cpp
--- a/dom/base/nsDOMJSUtils.h
+++ b/dom/base/nsDOMJSUtils.h
@@ -25,18 +25,16 @@ GetScriptContextFromJSContext(JSContext 
     do_QueryInterface(static_cast<nsISupports *>
                                  (::JS_GetContextPrivate(cx)));
 
   // This will return a pointer to something that's about to be
   // released, but that's ok here.
   return scx;
 }
 
-JSObject* GetDefaultScopeFromJSContext(JSContext *cx);
-
 // A factory function for turning a JS::Value argv into an nsIArray
 // but also supports an effecient way of extracting the original argv.
 // The resulting object will take a copy of the array, and ensure each
 // element is rooted.
 // Optionally, aArgv may be nullptr, in which case the array is allocated and
 // rooted, but all items remain nullptr.  This presumably means the caller
 // will then QI us for nsIJSArgArray, and set our array elements.
 nsresult NS_CreateJSArgv(JSContext *aContext, uint32_t aArgc,
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -376,25 +376,16 @@ nsJSUtils::ResetTimeZone()
 {
   JS::ResetTimeZone();
 }
 
 //
 // nsDOMJSUtils.h
 //
 
-JSObject* GetDefaultScopeFromJSContext(JSContext *cx)
-{
-  // DOM JSContexts don't store their default compartment object on
-  // the cx, so in those cases we need to fetch it via the scx
-  // instead.
-  nsIScriptContext *scx = GetScriptContextFromJSContext(cx);
-  return  scx ? scx->GetWindowProxy() : nullptr;
-}
-
 bool nsAutoJSString::init(const JS::Value &v)
 {
   JSContext* cx = nsContentUtils::RootingCxForThread();
   if (!init(nsContentUtils::RootingCxForThread(), v)) {
     JS_ClearPendingException(cx);
     return false;
   }