Backed out changeset 9b2c15970aa0 (bug 1222902) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 10 Nov 2015 11:23:06 +0100
changeset 271828 eeb80d0df72ffc3d0d1322aad64d0bfbf6c19d91
parent 271827 4d248cf02376b2cd0b357665dfe25ba46d9fa6c9
child 271829 0b8c387c386e0f08f34eda7de05541bdc6457836
push id18581
push usercbook@mozilla.com
push dateTue, 10 Nov 2015 10:23:38 +0000
treeherderb2g-inbound@eeb80d0df72f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1222902
milestone45.0a1
backs out9b2c15970aa07cc7d38b03e6106c71372624862b
Backed out changeset 9b2c15970aa0 (bug 1222902) for bustage
dom/audiochannel/AudioChannelAgent.cpp
dom/audiochannel/AudioChannelService.cpp
dom/audiochannel/AudioChannelService.h
dom/browser-element/BrowserElementAudioChannel.cpp
dom/html/nsBrowserElement.cpp
dom/ipc/TabChild.cpp
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -125,21 +125,16 @@ AudioChannelAgent::InitInternal(nsIDOMWi
   mAudioChannelType = aChannelType;
 
   if (aUseWeakRef) {
     mWeakCallback = do_GetWeakReference(aCallback);
   } else {
     mCallback = aCallback;
   }
 
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelAgent, InitInternal, this = %p, type = %d, "
-          "owner = %p, hasCallback = %d\n", this, mAudioChannelType,
-          mWindow.get(), (!!mCallback || !!mWeakCallback)));
-
   return NS_OK;
 }
 
 NS_IMETHODIMP AudioChannelAgent::NotifyStartedPlaying(uint32_t aNotifyPlayback,
                                                       float *aVolume,
                                                       bool* aMuted)
 {
   MOZ_ASSERT(aVolume);
@@ -158,35 +153,28 @@ NS_IMETHODIMP AudioChannelAgent::NotifyS
     return NS_ERROR_FAILURE;
   }
 
   service->RegisterAudioChannelAgent(this, aNotifyPlayback,
     static_cast<AudioChannel>(mAudioChannelType));
 
   service->GetState(mWindow, mAudioChannelType, aVolume, aMuted);
 
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelAgent, NotifyStartedPlaying, this = %p, mute = %d, "
-          "volume = %f\n", this, *aMuted, *aVolume));
-
   mNotifyPlayback = aNotifyPlayback;
   mIsRegToService = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP AudioChannelAgent::NotifyStoppedPlaying()
 {
   if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
       !mIsRegToService) {
     return NS_ERROR_FAILURE;
   }
 
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelAgent, NotifyStoppedPlaying, this = %p\n", this));
-
   RefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
   service->UnregisterAudioChannelAgent(this, mNotifyPlayback);
   mIsRegToService = false;
   return NS_OK;
 }
 
 already_AddRefed<nsIAudioChannelAgentCallback>
 AudioChannelAgent::GetCallback()
@@ -207,20 +195,16 @@ AudioChannelAgent::WindowVolumeChanged()
   }
 
   float volume = 1.0;
   bool muted = false;
 
   RefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
   service->GetState(mWindow, mAudioChannelType, &volume, &muted);
 
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelAgent, WindowVolumeChanged, this = %p, mute = %d, "
-          "volume = %f\n", this, muted, volume));
-
   callback->WindowVolumeChanged(volume, muted);
 }
 
 uint64_t
 AudioChannelAgent::WindowID() const
 {
   return mWindow ? mWindow->WindowID() : 0;
 }
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -73,21 +73,16 @@ public:
     nsAutoCString topic;
     topic.Assign("audiochannel-activity-");
     topic.Append(NS_ConvertUTF16toUTF8(name));
 
     observerService->NotifyObservers(wrapper, topic.get(),
                                      mActive
                                        ? MOZ_UTF16("active")
                                        : MOZ_UTF16("inactive"));
-
-    MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-           ("NotifyChannelActiveRunnable, type = %d, active = %d\n",
-            mAudioChannel, mActive));
-
     return NS_OK;
   }
 
 private:
   const uint64_t mWindowID;
   const AudioChannel mAudioChannel;
   const bool mActive;
 };
@@ -178,26 +173,16 @@ AudioChannelService::CreateServiceIfNeed
 /* static */ already_AddRefed<AudioChannelService>
 AudioChannelService::GetOrCreate()
 {
   CreateServiceIfNeeded();
   RefPtr<AudioChannelService> service = gAudioChannelService.get();
   return service.forget();
 }
 
-/* static */ PRLogModuleInfo*
-AudioChannelService::GetAudioChannelLog()
-{
-  static PRLogModuleInfo *gAudioChannelLog;
-  if (!gAudioChannelLog) {
-    gAudioChannelLog = PR_NewLogModule("AudioChannel");
-  }
-  return gAudioChannelLog;
-}
-
 void
 AudioChannelService::Shutdown()
 {
   if (gAudioChannelService) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
       obs->RemoveObserver(gAudioChannelService, "xpcom-shutdown");
       obs->RemoveObserver(gAudioChannelService, "outer-window-destroyed");
@@ -729,20 +714,16 @@ void
 AudioChannelService::SetAudioChannelVolume(nsPIDOMWindow* aWindow,
                                            AudioChannel aAudioChannel,
                                            float aVolume)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aWindow->IsOuterWindow());
 
-  MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelService, SetAudioChannelVolume, window = %p, type = %d, "
-          "volume = %d\n", aWindow, aAudioChannel, aVolume));
-
   AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
   winData->mChannels[(uint32_t)aAudioChannel].mVolume = aVolume;
   RefreshAgentsVolume(aWindow);
 }
 
 NS_IMETHODIMP
 AudioChannelService::SetAudioChannelVolume(nsIDOMWindow* aWindow,
                                            unsigned short aAudioChannel,
@@ -787,20 +768,16 @@ void
 AudioChannelService::SetAudioChannelMuted(nsPIDOMWindow* aWindow,
                                           AudioChannel aAudioChannel,
                                           bool aMuted)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aWindow->IsOuterWindow());
 
-  MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelService, SetAudioChannelMuted, window = %p, type = %d, "
-          "mute = %d\n", aWindow, aAudioChannel, aMuted));
-
   if (aAudioChannel == AudioChannel::System) {
     // Workaround for bug1183033, system channel type can always playback.
     return;
   }
 
   AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
   winData->mChannels[(uint32_t)aAudioChannel].mMuted = aMuted;
   RefreshAgentsVolume(aWindow);
--- a/dom/audiochannel/AudioChannelService.h
+++ b/dom/audiochannel/AudioChannelService.h
@@ -14,17 +14,16 @@
 #include "nsTArray.h"
 
 #include "AudioChannelAgent.h"
 #include "nsAttrValue.h"
 #include "mozilla/dom/AudioChannelBinding.h"
 
 class nsIRunnable;
 class nsPIDOMWindow;
-class PRLogModuleInfo;
 
 namespace mozilla {
 namespace dom {
 #ifdef MOZ_WIDGET_GONK
 class SpeakerManagerService;
 #endif
 
 #define NUMBER_OF_AUDIO_CHANNELS (uint32_t)AudioChannel::EndGuard_
@@ -41,18 +40,16 @@ public:
    * Returns the AudioChannelServce singleton.
    * If AudioChannelServce is not exist, create and return new one.
    * Only to be called from main thread.
    */
   static already_AddRefed<AudioChannelService> GetOrCreate();
 
   static bool IsAudioChannelMutedByDefault();
 
-  static PRLogModuleInfo* GetAudioChannelLog();
-
   /**
    * Any audio channel agent that starts playing should register itself to
    * this service, sharing the AudioChannel.
    */
   void RegisterAudioChannelAgent(AudioChannelAgent* aAgent,
                                  uint32_t aNotifyPlayback,
                                  AudioChannel aChannel);
 
--- a/dom/browser-element/BrowserElementAudioChannel.cpp
+++ b/dom/browser-element/BrowserElementAudioChannel.cpp
@@ -63,20 +63,16 @@ BrowserElementAudioChannel::Create(nsPID
     new BrowserElementAudioChannel(aWindow, aFrameLoader, aAPI,
                                    aAudioChannel, aManifestURL);
 
   aRv = ac->Initialize();
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("BrowserElementAudioChannel, Create, channel = %p, type = %d\n",
-          ac.get(), aAudioChannel));
-
   return ac.forget();
 }
 
 BrowserElementAudioChannel::BrowserElementAudioChannel(
                                                 nsPIDOMWindow* aWindow,
                                                 nsIFrameLoader* aFrameLoader,
                                                 nsIBrowserElementAPI* aAPI,
                                                 AudioChannel aAudioChannel,
@@ -607,19 +603,15 @@ BrowserElementAudioChannel::Observe(nsIS
 
   ProcessStateChanged(aData);
   return NS_OK;
 }
 
 void
 BrowserElementAudioChannel::ProcessStateChanged(const char16_t* aData)
 {
-  MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-         ("BrowserElementAudioChannel, ProcessStateChanged, this = %p, "
-          "type = %d\n", this, mAudioChannel));
-
   nsAutoString value(aData);
   mState = value.EqualsASCII("active") ? eStateActive : eStateInactive;
   DispatchTrustedEvent(NS_LITERAL_STRING("activestatechanged"));
 }
 
 } // dom namespace
 } // mozilla namespace
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -558,19 +558,16 @@ nsBrowserElement::GetAllowedAudioChannel
     }
 
     nsAutoString manifestURL;
     aRv = mozBrowserFrame->GetAppManifestURL(manifestURL);
     if (NS_WARN_IF(aRv.Failed())) {
       return;
     }
 
-    MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-            ("nsBrowserElement, GetAllowedAudioChannels, this = %p\n", this));
-
     GenerateAllowedAudioChannels(window, frameLoader, mBrowserElementAPI,
                                  manifestURL, mBrowserElementAudioChannels,
                                  aRv);
     if (NS_WARN_IF(aRv.Failed())) {
       return;
     }
   }
 
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -688,19 +688,16 @@ TabChild::Observe(nsISupports *aSubject,
     nsresult rv = wrapper->GetData(&windowID);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     // In theory a tabChild should contain just 1 top window, but let's double
     // check it comparing the windowID.
     if (window->WindowID() != windowID) {
-      MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
-              ("TabChild, Observe, different windowID, owner ID = %lld, "
-               "ID from wrapper = %lld", window->WindowID(), windowID));
       return NS_OK;
     }
 
     nsAutoString activeStr(aData);
     bool active = activeStr.EqualsLiteral("active");
     if (active != mAudioChannelsActive[audioChannel]) {
       mAudioChannelsActive[audioChannel] = active;
       Unused << SendAudioChannelActivityNotification(audioChannel, active);