Closed Bug 441197 Opened 16 years ago Closed 13 years ago

Gecko does not maintain an audio session on Vista+ (leading to no volume slider, inconsistent session title)

Categories

(Core :: Widget: Win32, defect, P2)

x86
Windows Vista
defect

Tracking

()

RESOLVED FIXED
mozilla7
Tracking Status
blocking2.0 --- -

People

(Reporter: ecopley, Assigned: khuey)

References

()

Details

(Keywords: common-issue+, polish, Whiteboard: [polish-interactive][good first bug][fixed-in-bs])

Attachments

(5 files, 7 obsolete files)

338.99 KB, image/png
Details
1.76 KB, patch
khuey
: review+
Details | Diff | Splinter Review
14.02 KB, patch
khuey
: review+
Details | Diff | Splinter Review
12.36 KB, patch
khuey
: review+
Details | Diff | Splinter Review
945 bytes, patch
dbaron
: review+
Details | Diff | Splinter Review
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

If you are using firefox it would be very useful if there was a volume control in the vista volume mixer before the sounds started playing. There is one if a sound is being played but not before. I am not sure that this is really a bug, it might be a designed feature of the volume mixer, but it would be very handy if just having a firefox window open would cause the volume mixer to add a slider for firefox. 

Reproducible: Always

Steps to Reproduce:
1.Open firefox - no volume slider appears.
2.
3.
Actual Results:  
No volume slider appears when you open the firefox window. It appears after the sounds have started playing.

Expected Results:  
It would be useful if the slider appeared as the firefox window opened.

No theme in use. Nothing special going on. Happens on all computers I have used with all configurations and all versions of firefox.
I can confirm this. It's also interesting to note flash doesn't show up under our volume control. (IE exhibits the same behavior.) Something to look at.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: enhancement → normal
Version: unspecified → Trunk
Chrome does always provide a mixer.
Safari doesn't.
Strange.
Keywords: polish
Whiteboard: [polish-interactive]
Assignee: nobody → jmathies
So I've been looking into implementing this.  The main barrier is that Gecko doesn't have a persistent audio object of any sort that can maintain the necessary Windows COM interfaces.  It's also worth noting that this is why Firefox et. al. do not appear as "Mozilla Firefox" above the volume slider but rather as the title of the currently focused window.
Assignee: jmathies → nobody
Component: Shell Integration → Widget: Win32
Product: Firefox → Core
QA Contact: shell.integration → win32
Summary: firefox does not activate a vista volume mixer slider unless it is actually playing a sound → Gecko does not maintain an audio session on Vista+ (leading to no volume slider, inconsistent session title)
Could we steal nsAppShell or create a new object with the same lifetime for this purpose?
Also might be worth considering how this interacts with multiple processes and our multi-process plans.
(In reply to comment #5)
> Also might be worth considering how this interacts with multiple processes and
> our multi-process plans.

Indeed.  The Audio API on Vista+ supports cross-process audio sessions so we can handle this.  I think we may even be able to leverage the API into controlling the audio streams in mozilla-runtime processes, making something like per-tab volume control possible
On trunk mozilla-runtime and firefox show up separately with OOPP.
The audio session GUID is roughly equivalent to the AppUserModelID the shell uses.  The difference is that we need that GUID to be unique per running session (i.e. one firefox.exe and it's associated mozilla-runtime.exes should share a GUID)  I think we'll need to generate a GUID at runtime and pass it across the proxy boundary.  This also may be wanted before OOPP ships as users are going to be very confused when they have to change the volume on "mozilla-runtime.exe"
Blocks: OOPP
After thinking about this a bit more, it makes more sense to use the GUID as a "Grouping Parameter"[0] rather than the actual session GUID.  It's a subtle difference, but it means we don't have to worry about what Flash/et. al. do on the native side of things.

[0] http://msdn.microsoft.com/en-us/library/dd370848%28VS.85%29.aspx
I have a patch for the non-OOPP parts of this, which has raised a number of questions.

Per the grouping parameter link in Comment 9, "In the case of a volume control for a grouping, Sndvol arbitrarily selects one of the sessions in the grouping as the source for the display name and icon that it displays with the volume control. Thus, to ensure that Sndvol always displays the same display name and icon for a grouping, all application instances that assign sessions to that grouping should ensure that their respective sessions have the same display name and icon."   

This means that I need to set the Audio Session's title and icon on both sides.  On the parent side this isn't too difficult (I'm currently using nsIXulAppInfo::name for the title) but it gets much harder on the child side.  Do I have access to things like nsIXulAppInfo on the child side?  If not, do we want to create subprotocols for platform specific stuff because we're going to need to pass at least three items across the boundary just for this simple audio issue.  It seems like cluttering up PPluginModule with that is at best inelegant.

Also, I assume the default behavior should be to fail silently (especially on the child side, not being able to give a title to the audio shouldn't quash the entire plugin load IMO).
Also testing other browsers, IE 8 gets this right (not surprising since the Grouping Parameter was created for IE 8 and the browser use case) and Chrome gets it wrong (Not all the processes are grouped.)
(In reply to comment #10)
> Do I have access to things like nsIXulAppInfo on the child side?  If not, do we

No.

> want to create subprotocols for platform specific stuff because we're going to
> need to pass at least three items across the boundary just for this simple
> audio issue.  It seems like cluttering up PPluginModule with that is at best
> inelegant.

Yes. See the patch in bug 563381. This is really easy to add. Do you still have this in your queue Kyle? Might be nice to get this landed. (I'm going to a file bug now on the icon issue.)
> (In reply to comment #10)
> Yes. See the patch in bug 563381. This is really easy to add. Do you still have
> this in your queue Kyle? Might be nice to get this landed. (I'm going to a file
> bug now on the icon issue.)

Yes.  I'll dig it out and see if I can't get it done relatively soon.
Assignee: nobody → me
Status: NEW → ASSIGNED
Priority: -- → P2
Attached patch Patch (obsolete) — Splinter Review
I'm cheating on some of the XPCOM stuff as the patch explains.  We can do it correctly if you like but I think this is good enough for the moment.  Patch itself works great.  It's worth noting that MSDN says that SndVol can pick any session to take the name and icon from but AFAICT it always takes the first one (meaning the parent process) which is nice because it means that we don't have to handle the icon stuff.

This applies over the patch in Bug 543061.  I threw this at try a few minutes ago and will post the build link when it is complete.
Attachment #443679 - Flags: review?(jmathies)
Attached patch Patch 1.1 (obsolete) — Splinter Review
Now with IDL
Attachment #443681 - Flags: review?(jmathies)
Attachment #443679 - Attachment is obsolete: true
Attachment #443679 - Flags: review?(jmathies)
There's also probably no need for this to be scriptable.  That came along from the copy/paste.
Attached patch Patch 1.2 (obsolete) — Splinter Review
And this version doesn't blow up every other platform.
Attachment #443681 - Attachment is obsolete: true
Attachment #443726 - Flags: review?(jmathies)
Attachment #443681 - Flags: review?(jmathies)
Does this work with out of process plugins? I've noticed since OOPP I can control flash's volume independently, which is good, I think.
This groups the plugins together with the parent process so the volume of everything is changed together.
There's some weirdness where if you launch the app once and load a youtube page or some other plugin it works, but if you close the app and relaunch it they show up separately again.  I think it's some sort of caching thing in SndVol.
Kyle, can I be a pain and ask that you split the plugin and widget code into two patches? One will have to go through ipc reviewers, the other through widget people.

(also, fyi, ipc reviewers tedn to be sticklers for 80 character limits on lines. Been there, done that!)
Attached patch Widget patch (obsolete) — Splinter Review
Attachment #443968 - Flags: review?(jmathies)
Attached patch Ipc patch (obsolete) — Splinter Review
Jim, can you suggest a reviewer for this?

There is some weirdness with closing and reopening the browser if you keep SndVol open throughout, but I'm not sure whether that's in my patch or in SndVol.
Attachment #443975 - Flags: review?
Comment on attachment 443968 [details] [diff] [review]
Widget patch

> PRUnichar *buffer;
> mIconPath.GetMutableData(&buffer, MAX_PATH);
> 
> if (::GetModuleFileName(NULL, buffer, MAX_PATH)) {
>   mIconPath.AppendLiteral(",0");
> }

After calling GetMutableData, the string length is set MAX_PATH. You need to terminate this and set the length manually based on the response, or just use a temporary [MAXPATH] buffer. Your append here basically fails. (actually it appends to the end at MAXPATH.) Although maybe we don't need this since windows grabs the first index by default..

> if (hr != S_OK)

Generally lets try to stick with COM's FAILED macro on these. 

Formatting nit - 

STDMETHODIMP
AudioSession::QueryInt

vs.

> STDMETHODIMP AudioSession::QueryInt

to keep lengths down.

>  	JumpListItem.cpp \
>+  AudioSession.cpp \
> 	$(NULL)

Try and clean up the formatting here, looks like the convention is to use a tab.

+  nsCOMPtr<nsIWinAudioSession> audioSession = 
+    do_GetService("@mozilla.org/windows-audio-session;1", &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ASSERTION(audioSession, "Could not create AudioSession object");
+  rv = audioSession->Start(); // This can fail if no audio devices exist
+                              // Or if we're running on a pre-Vista OS
+  if (NS_FAILED(rv))
+    audioSession = NULL;
+#endif

Maybe just manually warn here? I don't think we want to use NS_ENSURE_SUCCESS.

What kind of startup hit are we talking here? When you land this check perf stats to see if this effects start up times, or alternatively, is there any way we could delay calling Start() a bit? Either way we should always being thinking about ways to avoid added startup code.

Also, note roc will need to sr on interface / design.
Attachment #443968 - Flags: review?(jmathies) → review-
(In reply to comment #26)
> Created an attachment (id=443975) [details]
> Ipc patch
> 
> Jim, can you suggest a reviewer for this?
>

:bsmedberg would probably be best for this.
Hmm, also, I don't believe the path/icon code will work for xulrunner apps, which use the firefox.exe as a base. 

https://developer.mozilla.org/en/Getting_started_with_XULRunner

Might want to test with the sample and make sure your audio code works properly.
(In reply to comment #28)
> 
> +  nsCOMPtr<nsIWinAudioSession> audioSession = 
> +    do_GetService("@mozilla.org/windows-audio-session;1", &rv);
> +  NS_ENSURE_SUCCESS(rv, rv);
> +  NS_ASSERTION(audioSession, "Could not create AudioSession object");
> +  rv = audioSession->Start(); // This can fail if no audio devices exist
> +                              // Or if we're running on a pre-Vista OS
> +  if (NS_FAILED(rv))
> +    audioSession = NULL;
> +#endif
> 
> Maybe just manually warn here? I don't think we want to use NS_ENSURE_SUCCESS.

Not sure what the reasoning is here.  nsIWinAudioSession exists even when we're not on Vista and can't not exist now that malloc is infallible.  I actually think the code might be neater if AudioSession::GetSingleton fails on pre-Vista platforms so that consumers of the service only need to care about whether the service exists or not.

> What kind of startup hit are we talking here? When you land this check perf
> stats to see if this effects start up times, or alternatively, is there any way
> we could delay calling Start() a bit? Either way we should always being
> thinking about ways to avoid added startup code.
> 
> Also, note roc will need to sr on interface / design.

Unless we don't initialize COM during startup normally I would imagine it's fairly low.  This definitely needs to be measured though.  I'm not sure how we could delay it though, we need to establish the session before we play any audio and before we load any plugins (because they may play audio).
I think you'll need NS_IMPL_THREADSAFE_ISUPPORTS1, I'm seeing this on startup - 

###!!! ASSERTION: AudioSession not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file f:/Mozilla/firefox/mc/widget/src/windows/AudioSession.cpp, line 85
###!!! ASSERTION: AudioSession not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file f:/Mozilla/firefox/mc/widget/src/windows/AudioSession.cpp, line 85
###!!! ASSERTION: AudioSession not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file f:/Mozilla/firefox/mc/widget/src/windows/AudioSession.cpp, line 85
###!!! ASSERTION: AudioSession not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file f:/Mozilla/firefox/mc/widget/src/windows/AudioSession.cpp, line 85
(In reply to comment #31)
 I actually
> think the code might be neater if AudioSession::GetSingleton fails on pre-Vista
> platforms so that consumers of the service only need to care about whether the
> service exists or not.

^^ Thought that was the way it worked. Sounds like a good idea.
We should fix this for final, it's a fairly simple polish issue.  Hopefully I'll find some time to fix this up and get it in for another round of reviews soon,
blocking2.0: --- → ?
Attachment #443975 - Attachment is obsolete: true
Attachment #443975 - Flags: review?
We should fix this, but it's hard for me to say this blocks. Feel free to renom if you feel strongly.
blocking2.0: ? → -
I don't have time to finish this, but it should be fairly straightforward for somebody to pick up these patches and shepherd them into the tree.
Assignee: me → nobody
Status: ASSIGNED → NEW
Whiteboard: [polish-interactive] → [polish-interactive][good first bug]
I want to at least get the non-IPC part of this into 2.0.
Assignee: nobody → khuey
Attached patch widget/ patch (obsolete) — Splinter Review
Attachment #524185 - Flags: review?(jmathies)
Attached patch ipc patch (obsolete) — Splinter Review
Attachment #524186 - Flags: review?(benjamin)
Comment on attachment 524186 [details] [diff] [review]
ipc patch

I'm going to let jimm review both halves of this.
Attachment #524186 - Flags: review?(benjamin) → review?(jmathies)
Comment on attachment 524185 [details] [diff] [review]
widget/ patch

Review of attachment 524185 [details] [diff] [review]:

all in all nice looking code.

::: widget/src/windows/AudioSession.cpp
@@ +15,5 @@
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ *   Kyle Huey <me@kylehuey.com>

nit - This should be Mozilla Foundation w/ your name in the contributors list.

@@ +16,5 @@
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ *   Kyle Huey <me@kylehuey.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010

nit - 2011

@@ +45,5 @@
+#include "nsIStringBundle.h"
+#include "nsIUUIDGenerator.h"
+#include "nsIXULAppInfo.h"
+
+//#include "AudioSession.h"

nit - cleanup

@@ +162,5 @@
+// IAudioSessionEvents interface that will keep us alive until the appshell
+// calls Stop.
+nsresult
+AudioSession::Start()
+{

Lets make sure and run this through Talos looking for startup regressions.

@@ +228,5 @@
+  hr = manager->GetAudioSessionControl(NULL,
+                                       FALSE,
+                                       getter_AddRefs(mAudioSessionControl));
+  if (FAILED(hr))
+    return NS_ERROR_FAILURE;

On these failures, should we also consider calling Stop? It looks like we leave things in an unknown state.

@@ +303,5 @@
+
+STDMETHODIMP
+AudioSession::OnSessionDisconnected(AudioSessionDisconnectReason aReason)
+{
+  mAudioSessionControl->UnregisterAudioSessionNotification(this);

Lets check mAudioSessionControl just to be safe.
Attachment #524185 - Flags: review?(jmathies) → review+
Comment on attachment 524186 [details] [diff] [review]
ipc patch

Review of attachment 524186 [details] [diff] [review]:

r+ with comments addressed.

::: dom/plugins/PluginModuleChild.cpp
@@ +669,5 @@
     }
 
+#if defined XP_WIN && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
+    mozilla::widget::StopAudioSession();
+#endif

I think QuickExit is only used when we crash. We also want to shutdown on normal shut downs in AnswerNP_Shutdown. (A little debugging would confirm this.)

::: dom/plugins/PluginModuleParent.cpp
@@ +781,5 @@
+    nsID id;
+    nsString sessionName;
+    nsString iconPath;
+    rv = mozilla::widget::GetAudioSessionData(id, sessionName, iconPath);
+    if (NS_SUCCEEDED(rv)) {

Lets wrap these together and ditch rv.

@@ +783,5 @@
+    nsString iconPath;
+    rv = mozilla::widget::GetAudioSessionData(id, sessionName, iconPath);
+    if (NS_SUCCEEDED(rv)) {
+        if (!SendSetAudioSessionData(id, sessionName, iconPath))
+            return NS_ERROR_FAILURE;

I don't think we want to fail NP_Initialize here. Just call it and if it fails, oh well. If something is seriously wrong, CallNP_Initialize will catch it below.

::: widget/src/windows/AudioSession.cpp
@@ +328,5 @@
+{
+  lhs.m0 = rhs.m0;
+  lhs.m1 = rhs.m1;
+  lhs.m2 = rhs.m2;
+  for (int i = 0; i < 8; i++ ) {

nit - white space

@@ +339,5 @@
+                             nsString& aSessionName,
+                             nsString& aIconPath)
+{
+  NS_ABORT_IF_FALSE(mState != UNINITIALIZED && mState != STOPPED,
+                    "State invariants violated");

Do we really want to abort here if the audio session failed to startup properly?
Attachment #524186 - Flags: review?(jmathies) → review+
(In reply to comment #41)
> Comment on Review of attachment 524185 [details] [diff] [review]:
> widget/ patch
> 
> attachment 524185 [details] [diff] [review]
> 
> all in all nice looking code.

Thanks.

> ::: widget/src/windows/AudioSession.cpp
> @@ +15,5 @@
> + *
> + * The Original Code is mozilla.org code.
> + *
> + * The Initial Developer of the Original Code is
> + *   Kyle Huey <me@kylehuey.com>
> 
> nit - This should be Mozilla Foundation w/ your name in the contributors list.

I'm not a Mozilla employee.

> @@ +16,5 @@
> + * The Original Code is mozilla.org code.
> + *
> + * The Initial Developer of the Original Code is
> + *   Kyle Huey <me@kylehuey.com>
> + * Portions created by the Initial Developer are Copyright (C) 2010
> 
> nit - 2011
> 
> @@ +45,5 @@
> +#include "nsIStringBundle.h"
> +#include "nsIUUIDGenerator.h"
> +#include "nsIXULAppInfo.h"
> +
> +//#include "AudioSession.h"
> 
> nit - cleanup
> 
> @@ +162,5 @@
> +// IAudioSessionEvents interface that will keep us alive until the appshell
> +// calls Stop.
> +nsresult
> +AudioSession::Start()
> +{
> 
> Lets make sure and run this through Talos looking for startup regressions.
> 
> @@ +228,5 @@
> +  hr = manager->GetAudioSessionControl(NULL,
> +                                       FALSE,
> +                                       getter_AddRefs(mAudioSessionControl));
> +  if (FAILED(hr))
> +    return NS_ERROR_FAILURE;
> 
> On these failures, should we also consider calling Stop? It looks like we leave
> things in an unknown state.

Yes, probably.  At least the part that clears out mAudioSessionControl.

> @@ +303,5 @@
> +
> +STDMETHODIMP
> +AudioSession::OnSessionDisconnected(AudioSessionDisconnectReason aReason)
> +{
> +  mAudioSessionControl->UnregisterAudioSessionNotification(this);
> 
> Lets check mAudioSessionControl just to be safe.

OK.

(In reply to comment #42)
> Comment on Review of attachment 524186 [details] [diff] [review]:
> ipc patch
> 
> attachment 524186 [details] [diff] [review]
> 
> r+ with comments addressed.
> 
> ::: dom/plugins/PluginModuleChild.cpp
> @@ +669,5 @@
>      }
> 
> +#if defined XP_WIN && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
> +    mozilla::widget::StopAudioSession();
> +#endif
> 
> I think QuickExit is only used when we crash. We also want to shutdown on
> normal shut downs in AnswerNP_Shutdown. (A little debugging would confirm
> this.)

Interesting.  I'll verify and change.  That might explain the odd session lingering behavior I saw a couple times but couldn't reproduce.

> ::: dom/plugins/PluginModuleParent.cpp
> @@ +781,5 @@
> +    nsID id;
> +    nsString sessionName;
> +    nsString iconPath;
> +    rv = mozilla::widget::GetAudioSessionData(id, sessionName, iconPath);
> +    if (NS_SUCCEEDED(rv)) {
> 
> Lets wrap these together and ditch rv.

OK.

> @@ +783,5 @@
> +    nsString iconPath;
> +    rv = mozilla::widget::GetAudioSessionData(id, sessionName, iconPath);
> +    if (NS_SUCCEEDED(rv)) {
> +        if (!SendSetAudioSessionData(id, sessionName, iconPath))
> +            return NS_ERROR_FAILURE;
> 
> I don't think we want to fail NP_Initialize here. Just call it and if it fails,
> oh well. If something is seriously wrong, CallNP_Initialize will catch it
> below.

OK.

> ::: widget/src/windows/AudioSession.cpp
> @@ +328,5 @@
> +{
> +  lhs.m0 = rhs.m0;
> +  lhs.m1 = rhs.m1;
> +  lhs.m2 = rhs.m2;
> +  for (int i = 0; i < 8; i++ ) {
> 
> nit - white space
> 
> @@ +339,5 @@
> +                             nsString& aSessionName,
> +                             nsString& aIconPath)
> +{
> +  NS_ABORT_IF_FALSE(mState != UNINITIALIZED && mState != STOPPED,
> +                    "State invariants violated");
> 
> Do we really want to abort here if the audio session failed to startup
> properly?

No, this is bogus.  We probably want another state "FAILED" or something.  Aborting on shutdown on Windows XP is probably not the way to go here.

I'll fix this up this weekend.
Looks like it would be trivial to add a fix for bug 598792 after this lands.
Blocks: 598792
So I think I'm going to hold off on this until after we merge to aurora next week.  This seems like the kind of thing that should get some shaking out on the nightly branch first.
Unbitrotted.  This is from the other bug.
Attachment #541116 - Flags: review+
Attached patch widget/ patchSplinter Review
Unbitrotted and comments addressed.
Attachment #524185 - Attachment is obsolete: true
Attachment #541118 - Flags: review+
Attached patch ipc/ patchSplinter Review
Unbitrotted and comments addressed.
Attachment #524186 - Attachment is obsolete: true
Attachment #541119 - Flags: review+
So there's still one problem here.  The plugin process fails to print leak stats when run with this patch with certain plugins.  In particular, it breaks with the test plugin and with silverlight, but works with flash.
If I add an fflush call to the trace ref count stuff that fixes it ... but that's presumably wall paper over a real problem.
bent and I looked at this for some time this morning, and we couldn't find any misusage of the API in our patch.  We also noticed that we don't even fflush or fclose these file descriptors, so lets do that.
Attachment #541473 - Flags: review?(dbaron)
http://hg.mozilla.org/projects/build-system/rev/ffc023482b24
http://hg.mozilla.org/projects/build-system/rev/d004850a8358
http://hg.mozilla.org/projects/build-system/rev/3296e9564de6

Jumping the gun a bit here; if dbaron has comments I'll fix them in a followup.
Whiteboard: [polish-interactive][good first bug] → [polish-interactive][good first bug][fixed-in-bs]
Comment on attachment 541118 [details] [diff] [review]
widget/ patch

>diff --git a/widget/src/windows/nsAppShell.cpp b/widget/src/windows/nsAppShell.cpp
>--- a/widget/src/windows/nsAppShell.cpp
>+++ b/widget/src/windows/nsAppShell.cpp
>@@ -244,10 +245,20 @@ nsAppShell::Run(void)
> {
>   LoadedModuleInfo modules[NUM_LOADEDMODULEINFO];
>   memset(modules, 0, sizeof(modules));
>-  sLoadedModules = modules;
>+  sLoadedModules = modules;	

Trailing space :(
Comment on attachment 541119 [details] [diff] [review]
ipc/ patch

>diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp
>--- a/dom/plugins/ipc/PluginModuleParent.cpp
>+++ b/dom/plugins/ipc/PluginModuleParent.cpp
>@@ -757,6 +761,8 @@ PluginModuleParent::NP_Initialize(NPNets
> {
>     PLUGIN_LOG_DEBUG_METHOD;
> 
>+    nsresult rv;
>+

Unused?

>     mNPNIface = bFuncs;
> 
>     if (mShutdown) {
>@@ -764,6 +770,18 @@ PluginModuleParent::NP_Initialize(NPNets
>         return NS_ERROR_FAILURE;
>     }
> 
>+#if defined XP_WIN && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
>+    // Send the info needed to join the chrome process's audio session to the
>+    // plugin process
>+    nsID id;
>+    nsString sessionName;
>+    nsString iconPath;
>+
>+    if (NS_SUCCEEDED(mozilla::widget::GetAudioSessionData(id, sessionName,
>+                                                          iconPath)))
>+        SendSetAudioSessionData(id, sessionName, iconPath);
>+#endif
>+
>     if (!CallNP_Initialize(&mPluginThread, error))
>         return NS_ERROR_FAILURE;
>
Depends on: 719389
Depends on: 691355
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: