Bug 58592 - WebKit2: Need a way to keep the WebProcess alive for testing purposes
Summary: WebKit2: Need a way to keep the WebProcess alive for testing purposes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-04-14 15:57 PDT by Jessie Berlin
Modified: 2011-04-15 10:43 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.27 KB, patch)
2011-04-14 16:22 PDT, Jessie Berlin
bweinstein: review+
Details | Formatted Diff | Diff
Patch (Take 2) (4.55 KB, patch)
2011-04-15 09:40 PDT, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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