Clean up SuspendedPageProxy
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2018 16:36:55 +0000 (16:36 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2018 16:36:55 +0000 (16:36 +0000)
commitdc28ad652919fb5911f6aa3711a07dc952fac10a
treef4566a96597c3da9e7ecabfc40739a281a7a9333
parent5be8213e1a9056dbc37e3429320d64187f24ffd3
Clean up SuspendedPageProxy
https://bugs.webkit.org/show_bug.cgi?id=189517

Reviewed by Alex Christensen.

Clean up SuspendedPageProxy:
1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
   owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
   do not want it to outlive its WebPageProxy.
2. The SuspendedPageProxy destructor does not need to be virtual.
3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
   This is safer and avoid having to explicitly clear the pointer.
4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::setSuspendedPage):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::didFinishLoad):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::process const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeCreateSuspendedPage):
(WebKit::WebPageProxy::reattachToWebProcess):
* UIProcess/WebPageProxy.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebBackForwardListItem.cpp
Source/WebKit/Shared/WebBackForwardListItem.h
Source/WebKit/UIProcess/SuspendedPageProxy.cpp
Source/WebKit/UIProcess/SuspendedPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h