mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1222902 - Create log system for the AudioChannel. r=baku
This commit is contained in:
parent
e119284407
commit
2b592e152e
@ -130,6 +130,11 @@ AudioChannelAgent::InitInternal(nsIDOMWindow* aWindow, int32_t aChannelType,
|
||||
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;
|
||||
}
|
||||
|
||||
@ -158,6 +163,10 @@ NS_IMETHODIMP AudioChannelAgent::NotifyStartedPlaying(uint32_t aNotifyPlayback,
|
||||
|
||||
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;
|
||||
@ -170,6 +179,9 @@ NS_IMETHODIMP AudioChannelAgent::NotifyStoppedPlaying()
|
||||
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;
|
||||
@ -200,6 +212,10 @@ AudioChannelAgent::WindowVolumeChanged()
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,11 @@ public:
|
||||
mActive
|
||||
? MOZ_UTF16("active")
|
||||
: MOZ_UTF16("inactive"));
|
||||
|
||||
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
|
||||
("NotifyChannelActiveRunnable, type = %d, active = %d\n",
|
||||
mAudioChannel, mActive));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -178,6 +183,16 @@ AudioChannelService::GetOrCreate()
|
||||
return service.forget();
|
||||
}
|
||||
|
||||
/* static */ PRLogModuleInfo*
|
||||
AudioChannelService::GetAudioChannelLog()
|
||||
{
|
||||
static PRLogModuleInfo *gAudioChannelLog;
|
||||
if (!gAudioChannelLog) {
|
||||
gAudioChannelLog = PR_NewLogModule("AudioChannel");
|
||||
}
|
||||
return gAudioChannelLog;
|
||||
}
|
||||
|
||||
void
|
||||
AudioChannelService::Shutdown()
|
||||
{
|
||||
@ -719,6 +734,10 @@ AudioChannelService::SetAudioChannelVolume(nsPIDOMWindow* aWindow,
|
||||
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);
|
||||
@ -773,6 +792,10 @@ AudioChannelService::SetAudioChannelMuted(nsPIDOMWindow* aWindow,
|
||||
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;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
class nsIRunnable;
|
||||
class nsPIDOMWindow;
|
||||
class PRLogModuleInfo;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -45,6 +46,8 @@ public:
|
||||
|
||||
static bool IsAudioChannelMutedByDefault();
|
||||
|
||||
static PRLogModuleInfo* GetAudioChannelLog();
|
||||
|
||||
/**
|
||||
* Any audio channel agent that starts playing should register itself to
|
||||
* this service, sharing the AudioChannel.
|
||||
|
@ -68,6 +68,10 @@ BrowserElementAudioChannel::Create(nsPIDOMWindow* aWindow,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
|
||||
("BrowserElementAudioChannel, Create, channel = %p, type = %d\n",
|
||||
ac.get(), aAudioChannel));
|
||||
|
||||
return ac.forget();
|
||||
}
|
||||
|
||||
@ -608,6 +612,10 @@ BrowserElementAudioChannel::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
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"));
|
||||
|
@ -563,6 +563,9 @@ nsBrowserElement::GetAllowedAudioChannels(
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
|
||||
("nsBrowserElement, GetAllowedAudioChannels, this = %p\n", this));
|
||||
|
||||
GenerateAllowedAudioChannels(window, frameLoader, mBrowserElementAPI,
|
||||
manifestURL, mBrowserElementAudioChannels,
|
||||
aRv);
|
||||
|
@ -693,6 +693,9 @@ TabChild::Observe(nsISupports *aSubject,
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user