Bug 823273 - Part 2: Music volume should be faded when notification sound is on going - IPC changes. r=baku
authorMarco Chen <mchen@mozilla.com>
Mon, 02 Sep 2013 17:45:44 +0800
changeset 160198 7b4046fcaf530b4ad96a042e5e51ad2818ab093d
parent 160197 fd8ca2b2cbdb91f3af8f77145076aaee04a86d4a
child 160199 583edf914fd7339c10c1e3d94eac2b4ecd3e745b
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs823273
milestone26.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 823273 - Part 2: Music volume should be faded when notification sound is on going - IPC changes. r=baku
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
dom/ipc/TabMessageUtils.h
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1576,26 +1576,26 @@ ContentParent::RecvFirstIdle()
     // use as an indicator that it's a good time to prelaunch another process.
     // If we prelaunch any sooner than this, then we'll be competing with the
     // child process and slowing it down.
     PreallocatedProcessManager::AllocateAfterDelay();
     return true;
 }
 
 bool
-ContentParent::RecvAudioChannelGetMuted(const AudioChannelType& aType,
+ContentParent::RecvAudioChannelGetState(const AudioChannelType& aType,
                                         const bool& aElementHidden,
                                         const bool& aElementWasHidden,
-                                        bool* aValue)
+                                        AudioChannelState* aState)
 {
     nsRefPtr<AudioChannelService> service =
         AudioChannelService::GetAudioChannelService();
-    *aValue = false;
+    *aState = AUDIO_CHANNEL_STATE_NORMAL;
     if (service) {
-        *aValue = service->GetMutedInternal(aType, mChildID,
+        *aState = service->GetStateInternal(aType, mChildID,
                                             aElementHidden, aElementWasHidden);
     }
     return true;
 }
 
 bool
 ContentParent::RecvAudioChannelRegisterType(const AudioChannelType& aType)
 {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -409,20 +409,20 @@ private:
                                  const uint32_t& aColNumber,
                                  const uint32_t& aFlags,
                                  const nsCString& aCategory);
 
     virtual bool RecvPrivateDocShellsExist(const bool& aExist);
 
     virtual bool RecvFirstIdle();
 
-    virtual bool RecvAudioChannelGetMuted(const AudioChannelType& aType,
+    virtual bool RecvAudioChannelGetState(const AudioChannelType& aType,
                                           const bool& aElementHidden,
                                           const bool& aElementWasHidden,
-                                          bool* aValue);
+                                          AudioChannelState* aValue);
 
     virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType);
     virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType,
                                                 const bool& aElementHidden);
 
     virtual bool RecvAudioChannelChangedNotification();
 
     virtual bool RecvAudioChannelChangeDefVolChannel(
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -45,16 +45,17 @@ using ChromePackage;
 using ResourceMapping;
 using OverrideMapping;
 using base::ChildPrivileges;
 using IPC::Permission;
 using IPC::Principal;
 using mozilla::null_t;
 using mozilla::void_t;
 using mozilla::dom::AudioChannelType;
+using mozilla::dom::AudioChannelState;
 using mozilla::dom::BlobConstructorParams;
 using mozilla::dom::NativeThreadId;
 using mozilla::hal::ProcessPriority;
 using gfxIntSize;
 
 namespace mozilla {
 namespace dom {
 
@@ -431,19 +432,19 @@ parent:
 
     // Notify the parent of the presence or absence of private docshells
     PrivateDocShellsExist(bool aExist);
 
     // Tell the parent that the child has gone idle for the first time
     async FirstIdle();
 
     // Get Muted from the main AudioChannelService.
-    sync AudioChannelGetMuted(AudioChannelType aType, bool aElementHidden,
+    sync AudioChannelGetState(AudioChannelType aType, bool aElementHidden,
                               bool aElementWasHidden)
-        returns (bool value);
+        returns (AudioChannelState value);
 
     sync AudioChannelRegisterType(AudioChannelType aType);
     sync AudioChannelUnregisterType(AudioChannelType aType,
                                     bool aElementHidden);
 
     async AudioChannelChangedNotification();
     async AudioChannelChangeDefVolChannel(AudioChannelType aType,
                                           bool aHidden);
--- a/dom/ipc/TabMessageUtils.h
+++ b/dom/ipc/TabMessageUtils.h
@@ -60,12 +60,19 @@ struct ParamTraits<mozilla::dom::RemoteD
 
 template <>
 struct ParamTraits<mozilla::dom::AudioChannelType>
   : public EnumSerializer<mozilla::dom::AudioChannelType,
                           mozilla::dom::AUDIO_CHANNEL_DEFAULT,
                           mozilla::dom::AUDIO_CHANNEL_LAST>
 { };
 
+template <>
+struct ParamTraits<mozilla::dom::AudioChannelState>
+  : public EnumSerializer<mozilla::dom::AudioChannelState,
+                           mozilla::dom::AUDIO_CHANNEL_STATE_NORMAL,
+                           mozilla::dom::AUDIO_CHANNEL_STATE_LAST>
+{ };
+
 }
 
 
 #endif