Bug 58592

Summary: WebKit2: Need a way to keep the WebProcess alive for testing purposes
Product: WebKit Reporter: Jessie Berlin <jberlin>
Component: WebKit2Assignee: Jessie Berlin <jberlin>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, jberlin, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
bweinstein: review+
Patch (Take 2) none

Description Jessie Berlin 2011-04-14 15:57:23 PDT
<rdar://problem/9278779>
Comment 1 Jessie Berlin 2011-04-14 16:22:20 PDT
Created attachment 89679 [details]
Patch
Comment 2 Brian Weinstein 2011-04-14 16:50:20 PDT
Comment on attachment 89679 [details]
Patch

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

I feel like everywhere this should be webProcessCanTerminate instead of webProcessCanTerminateEarly.

> Source/WebKit2/UIProcess/WebContext.cpp:267
> +    m_webProcessCanTerminateEarly = allowed;

Is an early return if allowed == m_webProcessCanTerminateEarly helpful?

> Source/WebKit2/UIProcess/WebContext.h:265
> +    bool m_webProcessCanTerminateEarly;

Blank line before this might be nice.

> Source/WebKit2/UIProcess/API/C/WKContextPrivate.h:64
> +// FIXME: This is a workaround for testing purposes only.

So is this the FIXME to remove this? I'm not sure what the FIXME represents here.
Comment 3 Jessie Berlin 2011-04-14 16:54:47 PDT
(In reply to comment #2)
> (From update of attachment 89679 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89679&action=review
> 
> I feel like everywhere this should be webProcessCanTerminate instead of webProcessCanTerminateEarly.

Ok, I don't feel strongly about this. Changed to webProcessCanTerminate.

> 
> > Source/WebKit2/UIProcess/WebContext.cpp:267
> > +    m_webProcessCanTerminateEarly = allowed;
> 
> Is an early return if allowed == m_webProcessCanTerminateEarly helpful?

I don't think so, given the current implementation of shouldTerminate, but I will add it in case shouldTerminate for some reason gets more complicated.

> 
> > Source/WebKit2/UIProcess/WebContext.h:265
> > +    bool m_webProcessCanTerminateEarly;
> 
> Blank line before this might be nice.

Done.

> 
> > Source/WebKit2/UIProcess/API/C/WKContextPrivate.h:64
> > +// FIXME: This is a workaround for testing purposes only.
> 
> So is this the FIXME to remove this? I'm not sure what the FIXME represents here.

Yes, we should come up with a way to do the testing such that this is not necessary. I will revise the comment to say:

// FIXME: This is a workaround for testing purposes only and should be removed once a better solution has been found for testing.
Comment 4 Anders Carlsson 2011-04-14 17:00:25 PDT
Comment on attachment 89679 [details]
Patch

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

> Source/WebKit2/UIProcess/API/C/WKContextPrivate.h:66
> +WK_EXPORT void WKContextSetWebProcessCanTerminateEarly(WKContextRef context, bool canTerminate);
> +

I don't like this name. Could we instead have

WKContextDisableProcessTermination and WKContextEnableProcessTermination?
Comment 5 Jessie Berlin 2011-04-15 08:43:10 PDT
(In reply to comment #4)
> (From update of attachment 89679 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89679&action=review
> 
> > Source/WebKit2/UIProcess/API/C/WKContextPrivate.h:66
> > +WK_EXPORT void WKContextSetWebProcessCanTerminateEarly(WKContextRef context, bool canTerminate);
> > +
> 
> I don't like this name. Could we instead have
> 
> WKContextDisableProcessTermination and WKContextEnableProcessTermination?

I will change it to use those names, and since that is so much of the patch I will send it out for review again.
Comment 6 Jessie Berlin 2011-04-15 09:40:18 PDT
Created attachment 89798 [details]
Patch (Take 2)
Comment 7 Jessie Berlin 2011-04-15 10:43:36 PDT
Comment on attachment 89798 [details]
Patch (Take 2)

Committed in http://trac.webkit.org/changeset/83988