Bug 58476

Summary: Add support for disabling/enabling termination to ChildProcess
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch aroben: review+

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>