Bug 1547923 part 1. Remove unused callers of GetGlobalJSObject. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 02 May 2019 18:37:52 +0000
changeset 472513 57f7cff9a4b1f38d75dc80aab34d209c75254270
parent 472512 cf9f2fb3cfad4ba66bae732ae7c9acf21b7ff6dd
child 472514 64fb8460f0f87df8c59a5f49ebb4837dde1adb90
push id84697
push userbzbarsky@mozilla.com
push dateFri, 03 May 2019 15:19:53 +0000
treeherderautoland@a0971c8a28a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1547923
milestone68.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 1547923 part 1. Remove unused callers of GetGlobalJSObject. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D29702
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
dom/script/ScriptSettings.h
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -1152,26 +1152,16 @@ void AudioContext::RegisterNode(AudioNod
   mAllNodes.PutEntry(aNode);
 }
 
 void AudioContext::UnregisterNode(AudioNode* aNode) {
   MOZ_ASSERT(mAllNodes.Contains(aNode));
   mAllNodes.RemoveEntry(aNode);
 }
 
-JSObject* AudioContext::GetGlobalJSObject() const {
-  nsCOMPtr<nsIGlobalObject> parentObject = do_QueryInterface(GetParentObject());
-  if (!parentObject) {
-    return nullptr;
-  }
-
-  // This can also return null.
-  return parentObject->GetGlobalJSObject();
-}
-
 already_AddRefed<Promise> AudioContext::StartRendering(ErrorResult& aRv) {
   nsCOMPtr<nsIGlobalObject> parentObject = do_QueryInterface(GetParentObject());
 
   MOZ_ASSERT(mIsOffline, "This should only be called on OfflineAudioContext");
   if (mIsStarted) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
--- a/dom/media/webaudio/AudioContext.h
+++ b/dom/media/webaudio/AudioContext.h
@@ -311,18 +311,16 @@ class AudioContext final : public DOMEve
 
   uint32_t MaxChannelCount() const;
 
   uint32_t ActiveNodeCount() const;
 
   void Mute() const;
   void Unmute() const;
 
-  JSObject* GetGlobalJSObject() const;
-
   void RegisterNode(AudioNode* aNode);
   void UnregisterNode(AudioNode* aNode);
 
   void OnStateChanged(void* aPromise, AudioContextState aNewState);
 
   BasicWaveFormCache* GetBasicWaveFormCache();
 
   void ShutdownWorklet();
--- a/dom/script/ScriptSettings.h
+++ b/dom/script/ScriptSettings.h
@@ -113,23 +113,16 @@ nsIGlobalObject* GetCurrentGlobal();
 //   This defaults to null.
 // * When we push an Entry Point in preparation to run a JS-implemented WebIDL
 //   callback, we grab the subject principal at the time of invocation, and
 //   store that as the WebIDL Caller Principal.
 // * When non-null, callers can query this principal from script via an API on
 //   Components.utils.
 nsIPrincipal* GetWebIDLCallerPrincipal();
 
-// This may be used by callers that know that their incumbent global is non-
-// null (i.e. they know there have been no System Caller pushes since the
-// inner-most script execution).
-inline JSObject& IncumbentJSGlobal() {
-  return *GetIncumbentGlobal()->GetGlobalJSObject();
-}
-
 // Returns whether JSAPI is active right now.  If it is not, working with a
 // JSContext you grab from somewhere random is not OK and you should be doing
 // AutoJSAPI or AutoEntryScript to get yourself a properly set up JSContext.
 bool IsJSAPIActive();
 
 namespace danger {
 
 // Get the JSContext for this thread.  This is in the "danger" namespace because