Bug 58476 - Add support for disabling/enabling termination to ChildProcess
Summary: Add support for disabling/enabling termination to ChildProcess
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-13 14:03 PDT by Anders Carlsson
Modified: 2011-04-13 14:29 PDT (History)
1 user (show)

See Also:


Attachments
Patch (10.30 KB, patch)
2011-04-13 14:10 PDT, Anders Carlsson
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2011-04-13 14:03:57 PDT
Add support for disabling/enabling termination to ChildProcess
Comment 1 Anders Carlsson 2011-04-13 14:10:06 PDT
Created attachment 89452 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-04-13 14:15:16 PDT
Comment on attachment 89452 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=89452&action=review

> Source/WebKit2/ChangeLog:28
> +        (WebKit::PluginProcess::getSitesWithData):
> +        Call disableTermination()/enableTermination().
> +
> +        (WebKit::PluginProcess::clearSiteData):
> +        Ditto.

Why do we need to wrap these functions in disable/enable calls?

> Source/WebKit2/Shared/ChildProcess.h:39
> +    void disableTermination();
> +    void enableTermination();

Maybe there should be comments here instead of/in addition to the ones for m_terminationCounter.

> Source/WebKit2/WebProcess/WebProcess.cpp:121
> +    : ChildProcess(0.0)

Can you get rid of the .0?
Comment 3 Anders Carlsson 2011-04-13 14:19:03 PDT
(In reply to comment #2)
> (From update of attachment 89452 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89452&action=review
> 
> > Source/WebKit2/ChangeLog:28
> > +        (WebKit::PluginProcess::getSitesWithData):
> > +        Call disableTermination()/enableTermination().
> > +
> > +        (WebKit::PluginProcess::clearSiteData):
> > +        Ditto.
> 
> Why do we need to wrap these functions in disable/enable calls?

Because without a call to enableTermination, the timer will never start.

> 
> > Source/WebKit2/Shared/ChildProcess.h:39
> > +    void disableTermination();
> > +    void enableTermination();
> 
> Maybe there should be comments here instead of/in addition to the ones for m_terminationCounter.

I'll add comments.

> 
> > Source/WebKit2/WebProcess/WebProcess.cpp:121
> > +    : ChildProcess(0.0)
> 
> Can you get rid of the .0?

Yes.
Comment 4 Adam Roben (:aroben) 2011-04-13 14:25:15 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 89452 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=89452&action=review
> > 
> > > Source/WebKit2/ChangeLog:28
> > > +        (WebKit::PluginProcess::getSitesWithData):
> > > +        Call disableTermination()/enableTermination().
> > > +
> > > +        (WebKit::PluginProcess::clearSiteData):
> > > +        Ditto.
> > 
> > Why do we need to wrap these functions in disable/enable calls?
> 
> Because without a call to enableTermination, the timer will never start.

So there's some case where someone will create PluginProcess that has no web process connections, will then call one of these functions, and expect the process to exit on its own?
Comment 5 Anders Carlsson 2011-04-13 14:26:36 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (From update of attachment 89452 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=89452&action=review
> > > 
> > > > Source/WebKit2/ChangeLog:28
> > > > +        (WebKit::PluginProcess::getSitesWithData):
> > > > +        Call disableTermination()/enableTermination().
> > > > +
> > > > +        (WebKit::PluginProcess::clearSiteData):
> > > > +        Ditto.
> > > 
> > > Why do we need to wrap these functions in disable/enable calls?
> > 
> > Because without a call to enableTermination, the timer will never start.
> 
> So there's some case where someone will create PluginProcess that has no web process connections, will then call one of these functions, and expect the process to exit on its own?

That is correct. The web process is not involved in getSitesWithData/clearSiteData.
Comment 6 Anders Carlsson 2011-04-13 14:29:43 PDT
Committed r83767: <http://trac.webkit.org/changeset/83767>