Closed Bug 544345 Opened 14 years ago Closed 14 years ago

Utilize IPDL hang detection in PluginModuleParent and set timeout based on pref

Categories

(Core Graveyard :: Plug-ins, enhancement)

enhancement
Not set
normal

Tracking

(status1.9.2 .4-fixed)

RESOLVED FIXED
Tracking Status
status1.9.2 --- .4-fixed

People

(Reporter: cjones, Assigned: cjones)

References

Details

(Whiteboard: [fixed-lorentz])

Attachments

(3 files)

How does "dom.ipc.plugins.timeoutSecs" sound?  I'd also like to default its value to that of the JS slow-script timeout based on the assumption that that value was chosen after discussion/experience/UX considerations.
This isn't shippable code, just a stepping stone to bug 544095.
Assignee: nobody → jones.chris.g
Attachment #425328 - Flags: review?(benjamin)
Requesting review because I don't feel 100% comfortable with mochitests.  Don't want nondeterministic crud.
Attachment #425329 - Flags: review?(benjamin)
Comment on attachment 425328 [details] [diff] [review]
Kill plugins if they exceed the hang timeout.

>diff --git a/dom/plugins/PluginModuleParent.cpp b/dom/plugins/PluginModuleParent.cpp

>+static const char* kTimeoutPref = "dom.ipc.plugins.timeoutSecs";

This could be `static char const *const kTimeoutPref`, but it would be best as `static const char kTimeoutPref[]`;

>+    nsContentUtils::RegisterPrefCallback(kTimeoutPref, TimeoutChanged, parent);
>+    TimeoutChanged(kTimeoutPref, parent);

The contentutils pref callback perpetuates the awful nsIPref callback design. But given that the only other option is an XPCOM object, I guess this is expedient. Why can't this be in the PluginModuleParent constructor, though, so that Register/Unregister are a matched pair, easy to find?

r=me with those changes
Attachment #425328 - Flags: review?(benjamin) → review+
(In reply to comment #3)
> >+    nsContentUtils::RegisterPrefCallback(kTimeoutPref, TimeoutChanged, parent);
> >+    TimeoutChanged(kTimeoutPref, parent);
> 
> The contentutils pref callback perpetuates the awful nsIPref callback design.
> But given that the only other option is an XPCOM object, I guess this is
> expedient. Why can't this be in the PluginModuleParent constructor, though, so
> that Register/Unregister are a matched pair, easy to find?
> 

Alas, but the RPCChannel isn't usable until after toplevelActor.Open() has been called.
(In reply to comment #4)
> (In reply to comment #3)
> > >+    nsContentUtils::RegisterPrefCallback(kTimeoutPref, TimeoutChanged, parent);
> > >+    TimeoutChanged(kTimeoutPref, parent);
> > 
> > The contentutils pref callback perpetuates the awful nsIPref callback design.
> > But given that the only other option is an XPCOM object, I guess this is
> > expedient. Why can't this be in the PluginModuleParent constructor, though, so
> > that Register/Unregister are a matched pair, easy to find?
> > 
> 
> Alas, but the RPCChannel isn't usable until after toplevelActor.Open() has been
> called.

Ignore that.  I'll Register() in the ctor, then do the initial TimeoutChanged() in LoadModule().
Attachment #425329 - Flags: review?(benjamin) → review+
Blanket approval for Lorentz merge to mozilla-1.9.2
a=beltzner for 1.9.2.4 - please make sure to mark status1.9.2:.4-fixed
Depends on: 560932
(In reply to comment #0)
> How does "dom.ipc.plugins.timeoutSecs" sound?  I'd also like to default its
> value to that of the JS slow-script timeout based on the assumption that that
> value was chosen after discussion/experience/UX considerations.

The 10 second wall-time default wasn't based on much more than gut check and then seeing if we got too many false positives.

We do get false positives, even (until recent post-3.6 changes, I think) for our session restore chrome code.

I'm way late here, but the obvious difference between the slow script watchdog timeout and this one is this one is fatal -- the slow script dialog lets the user continue or stop. That overrides any default timeout value consideration!

/be
As comment 1 noted, these patches were a stepping stone to what I thought bug 544095 was to be, a "Should this plugin be killed?" dialog.  But those patches were ui-r-'d, so the assumptions of comment 0 were invalid.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: