Bug 1580659 - part8 : trimming public methods of AudioChannelAgent. r=chunmin
authorAlastor Wu <alwu@mozilla.com>
Tue, 24 Sep 2019 06:55:33 +0000
changeset 494865 c2bbb774843e472e5c19f5e69a2898fd3c5c758e
parent 494864 99500f4bb1460189b3a8e0b8b494da1ff8ec79a3
child 494866 c737a0b6b1b3a9f4ecfde5481c931f9cb7eb309c
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschunmin
bugs1580659
milestone71.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 1580659 - part8 : trimming public methods of AudioChannelAgent. r=chunmin To hide some functions from `AudioChannelAgent` to avoid an access from `AudioChannelAgentCallback` (eg. media element, audio destination node...), and only allow `AudioChannelService` to use those functions. Differential Revision: https://phabricator.services.mozilla.com/D45755
dom/audiochannel/AudioChannelAgent.h
--- a/dom/audiochannel/AudioChannelAgent.h
+++ b/dom/audiochannel/AudioChannelAgent.h
@@ -32,32 +32,32 @@ class AudioChannelAgent : public nsIAudi
 
   // nsIAudioChannelAgentCallback MUST call this function after calling
   // NotifyStartedPlaying() to require the initial update for
   // volume/suspend/audio-capturing which might set before starting the agent.
   // Ex. starting the agent in a tab which has been muted before, so the agent
   // should apply mute state to its callback.
   void PullInitialUpdate();
 
-  void WindowVolumeChanged(float aVolume, bool aMuted);
-  void WindowSuspendChanged(nsSuspendedTypes aSuspend);
-  void WindowAudioCaptureChanged(uint64_t aInnerWindowID, bool aCapture);
-
-  nsPIDOMWindowOuter* Window() const { return mWindow; }
-
   uint64_t WindowID() const;
-  uint64_t InnerWindowID() const;
 
   bool IsWindowAudioCapturingEnabled() const;
   bool IsPlayingStarted() const;
   bool ShouldBlockMedia() const;
 
  private:
   virtual ~AudioChannelAgent();
 
+  friend class AudioChannelService;
+  void WindowVolumeChanged(float aVolume, bool aMuted);
+  void WindowSuspendChanged(nsSuspendedTypes aSuspend);
+  void WindowAudioCaptureChanged(uint64_t aInnerWindowID, bool aCapture);
+
+  nsPIDOMWindowOuter* Window() const { return mWindow; }
+  uint64_t InnerWindowID() const;
   AudioPlaybackConfig GetMediaConfig() const;
   bool IsDisposableSuspend(nsSuspendedTypes aSuspend) const;
 
   // Returns mCallback if that's non-null, or otherwise tries to get an
   // nsIAudioChannelAgentCallback out of mWeakCallback.
   already_AddRefed<nsIAudioChannelAgentCallback> GetCallback();
 
   nsresult InitInternal(nsPIDOMWindowInner* aWindow,