PluginProcessParent's pointer to its LaunchRunnable must remain non-null until the runnable has executed

RESOLVED FIXED in mozilla37

Status

()

Core
Plug-ins
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: aklotz, Assigned: aklotz)

Tracking

unspecified
mozilla37
x86
Windows 8.1
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Otherwise things behave badly if we want to do a WaitUntilConnected when the runnable is already queued up to the main thread message_loop.
Created attachment 8545559 [details] [diff] [review]
Fix
Attachment #8545559 - Flags: review?(gfritzsche)
The problem is as follows:

When we are forced to wait synchronously for plugin initialization (for example a script is querying for a property), we might need to wait for the plugin container to launch.

Normally the runnable would be enqueued to the main thread and would eventually execute. Unfortunately in this scenario. That won't work in this case because the main thread must block until the plugin has launched, so in this case we execute the runnable immediately.

Without this patch, we could have a scenario where the process launch runnable would be enqueued to the main thread and PluginProcessParent::mLaunchCompleteRunnable is then set to nullptr. When the main thread tries to execute the runnable immediately, it sees a null runnable (which is incorrect), does not finish setting up the plugin process, and then tries to do stuff with the plugin.

This fix ensures that the runnable pointer is non-null until it executes either immediately or from the main thread message loop.
(Ignore the "Unfortunately in this scenario.")
Attachment #8545559 - Flags: review?(gfritzsche) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/06402d84ac3d
https://hg.mozilla.org/mozilla-central/rev/06402d84ac3d
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.