Bug 58485 - Convert WebProcess over to using disableTermination/enableTermination
Summary: Convert WebProcess over to using disableTermination/enableTermination
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:58 PDT by Anders Carlsson
Modified: 2011-04-13 15:24 PDT (History)
0 users

See Also:


Attachments
Patch (24.51 KB, patch)
2011-04-13 15:03 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:58:32 PDT
Convert WebProcess over to using disableTermination/enableTermination
Comment 1 Anders Carlsson 2011-04-13 15:03:32 PDT
Created attachment 89470 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-04-13 15:13:41 PDT
Comment on attachment 89470 [details]
Patch

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

It's a little confusing that all the terminateIfPossible calls have turned into a temporary disabling of termination.

> Source/WebKit2/WebProcess/WebProcess.cpp:505
>  void WebProcess::removeWebPage(uint64_t pageID)
>  {
>      m_pageMap.remove(pageID);
> -    terminateIfPossible();
> +
> +    enableTermination();

Do we need to verify that pageID was in m_pageMap?

> Source/WebKit2/WebProcess/WebProcess.cpp:733
> +    WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());

No need for either of the "WebProcess::"s.

> Source/WebKit2/WebProcess/WebProcess.cpp:755
> +    WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());

Or here.

> Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp:158
> +    ChildProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());

Why ChildProcess and not WebProcess?
Comment 3 Anders Carlsson 2011-04-13 15:19:32 PDT
(In reply to comment #2)
> (From update of attachment 89470 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89470&action=review
> 
> It's a little confusing that all the terminateIfPossible calls have turned into a temporary disabling of termination.
> 
> > Source/WebKit2/WebProcess/WebProcess.cpp:505
> >  void WebProcess::removeWebPage(uint64_t pageID)
> >  {
> >      m_pageMap.remove(pageID);
> > -    terminateIfPossible();
> > +
> > +    enableTermination();
> 
> Do we need to verify that pageID was in m_pageMap?
> 

Not really, but I added an assertion.

> > Source/WebKit2/WebProcess/WebProcess.cpp:733
> > +    WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
> 
> No need for either of the "WebProcess::"s.

changed WebProcess::shared() to *this.
> 
> > Source/WebKit2/WebProcess/WebProcess.cpp:755
> > +    WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
> 
> Or here.
> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp:158
> > +    ChildProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
> 
> Why ChildProcess and not WebProcess?

Changed to WebProcess.
Comment 4 Anders Carlsson 2011-04-13 15:24:35 PDT
Committed r83774: <http://trac.webkit.org/changeset/83774>