Skip to content
Permalink
Browse files
WebPageProxy::isValid should return false if the page has been explic…
…itly closed

https://bugs.webkit.org/show_bug.cgi?id=48458

Reviewed by Sam Weinig.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::isValid):
(WebKit::WebPageProxy::relaunch):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isClosed):

Canonical link: https://commits.webkit.org/61215@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Oct 27, 2010
1 parent d2e4ebe commit 1227dab7edc9709c5d6f7b2ea9baaa2dee7665a8
Showing 3 changed files with 32 additions and 9 deletions.
@@ -1,3 +1,19 @@
2010-10-27 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

WebPageProxy::isValid should return false if the page has been explicitly closed
https://bugs.webkit.org/show_bug.cgi?id=48458

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::isValid):
(WebKit::WebPageProxy::relaunch):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isClosed):

2010-10-27 Anders Carlsson <andersca@apple.com>

Reviewed by Adam Roben.
@@ -83,8 +83,8 @@ WebPageProxy::WebPageProxy(WebPageNamespace* pageNamespace, uint64_t pageID)
, m_backForwardList(WebBackForwardList::create(this))
, m_textZoomFactor(1)
, m_pageZoomFactor(1)
, m_valid(true)
, m_closed(false)
, m_isValid(true)
, m_isClosed(false)
, m_pageID(pageID)
{
#ifndef NDEBUG
@@ -106,7 +106,11 @@ WebProcessProxy* WebPageProxy::process() const

bool WebPageProxy::isValid()
{
return m_valid;
// A page that has been explicitly closed is never valid.
if (m_isClosed)
return false;

return m_isValid;
}

void WebPageProxy::setPageClient(PageClient* pageClient)
@@ -149,7 +153,7 @@ void WebPageProxy::initializeFindClient(const WKPageFindClient* client)

void WebPageProxy::relaunch()
{
m_valid = true;
m_isValid = true;
m_pageNamespace->context()->relaunchProcessIfNecessary();
m_pageNamespace->process()->addExistingWebPage(this, m_pageID);

@@ -181,7 +185,7 @@ void WebPageProxy::close()
if (!isValid())
return;

m_closed = true;
m_isClosed = true;

process()->disconnectFramesFromPage(this);
m_mainFrame = 0;
@@ -1206,7 +1210,7 @@ void WebPageProxy::processDidCrash()
{
ASSERT(m_pageClient);

m_valid = false;
m_isValid = false;

if (m_mainFrame)
m_urlAtProcessExit = m_mainFrame->url();
@@ -124,7 +124,7 @@ class WebPageProxy : public APIObject {

void close();
bool tryClose();
bool isClosed() const { return m_closed; }
bool isClosed() const { return m_isClosed; }

void loadURL(const String&);
void loadURLRequest(WebURLRequest*);
@@ -362,8 +362,11 @@ class WebPageProxy : public APIObject {
double m_textZoomFactor;
double m_pageZoomFactor;

bool m_valid;
bool m_closed;
// If the process backing the web page is alive and kicking.
bool m_isValid;

// Whether WebPageProxy::close() has been called on this page.
bool m_isClosed;

uint64_t m_pageID;

0 comments on commit 1227dab

Please sign in to comment.