Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alerts and other blocking browser calls time out #24

Open
davidben opened this issue Apr 23, 2011 · 4 comments
Open

alerts and other blocking browser calls time out #24

davidben opened this issue Apr 23, 2011 · 4 comments
Milestone

Comments

@davidben
Copy link
Owner

Some javascript calls block, notably alert(). This is a problem as the viewer does not know the browser's spawned a nested event loop and eventually times out. Probably we need to inform the viewer about this when appropriate or simply never time the viewer out. The latter may actually be a better approach (and more consistent with the plugin world), but we need to be careful not to leak the viewer when the wrapper crashes.

This is not a regression from anything I did, so I'm marking this for 1.6.0.

davidben added a commit that referenced this issue Apr 23, 2011
This reverts commit 1b259a8. If you
call a function from Flash that ends up opening an alert, the call
blocks until the user closes the alert, and the call eventually times
out. A 30 second timeout isn't much better, but is harder to trigger
accidentally, whereas it's not difficult to trigger a 10 second timeout
on accident.

See bug #24.
@davidben
Copy link
Owner Author

Though even if the viewer never times out, we may still need to communicate nested event loops. If the plugin expects its timers to still fired in a nested event loop, we'll need to be careful about things.

Really, blocking calls are just a terrible terrible idea.

@davidben
Copy link
Owner Author

This appears to also hit file upload dialogs. From a recent Google search:

flash-plugin and nspluginwrapper have an interesting conflict where
file selection boxes used for flash upload dialogs get closed randomly.

@davidben
Copy link
Owner Author

Alright, we do have to support a recursive GTK event loop. Disassembling flashplayer suggests it calls gtk_dialog_run when it creates a GtkFileSelector. (Wasn't that been deprecated for GtkFileChooser forever ago.) Alerts probably are a browser-side child event loop to deal with later. For plug-in-side ones, we probably want to detect them (hijack the poll func I guess) and then send the wrapper a message that we wish to recurse. And then the wrapper does a recursive event loop to follow suit and we continue with the sync event stuff. (Which will have to be rewritten AGAIN to use a poll func hack.)

@davidben
Copy link
Owner Author

davidben commented Jun 7, 2011

One nuisance: what happens when the browser event loop isn't glib? Nested Xt event loops aren't worth supporting (if that's possible), but hopefully the world will move to NPN_PluginThreadAsyncCall. If we do (#17) before Flash does, things may be complicated... likely any "launch recursive event loop" RPC will need to have a fallback of some sort. Also such an RPC probably doesn't quite fit the method call pattern everywhere else as it'll integrate with sync/unsync.

On the other hand, browsers aren't going to stop using the glib event loop before Flash does, so #17 is probably uninteresting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant