Skip to content
Permalink
Browse files
Web Inspector: [Mac] Occosional Crashes Closing Inspector
https://bugs.webkit.org/show_bug.cgi?id=139740

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-12-17
Reviewed by Timothy Hatcher.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent):
The WebPageProxy could have gotten destroyed in handling (e.g. keyboard shortcut
to close the Inspector Window), so protect the object to avoid destruction
during handling.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebPageProxy.cpp:
Add platformInvalidate opportunity for the platform to do invalidation work.

* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformInvalidate):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformInvalidate):
Empty implementations, these ports do not need to do anything.

* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::closeTimerFired):
(WebKit::WebInspectorProxy::platformDidClose):
(WebKit::WebInspectorProxy::platformInvalidate):
When closing / invalidating make sure we close the WKView to clear client
for any delayed callbacks.

Canonical link: https://commits.webkit.org/157649@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JosephPecoraro authored and webkit-commit-queue committed Dec 17, 2014
1 parent c688f1e commit a25ad390637a08394f0859cba537b8b283ec450b
@@ -1,3 +1,34 @@
2014-12-17 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: [Mac] Occosional Crashes Closing Inspector
https://bugs.webkit.org/show_bug.cgi?id=139740

Reviewed by Timothy Hatcher.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent):
The WebPageProxy could have gotten destroyed in handling (e.g. keyboard shortcut
to close the Inspector Window), so protect the object to avoid destruction
during handling.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebPageProxy.cpp:
Add platformInvalidate opportunity for the platform to do invalidation work.

* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformInvalidate):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformInvalidate):
Empty implementations, these ports do not need to do anything.

* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::closeTimerFired):
(WebKit::WebInspectorProxy::platformDidClose):
(WebKit::WebInspectorProxy::platformInvalidate):
When closing / invalidating make sure we close the WKView to clear client
for any delayed callbacks.

2014-12-17 Chris Dumez <cdumez@apple.com>

[iOS] Make it possible to toggle FeatureCounter support at runtime
@@ -170,6 +170,7 @@ void WebInspectorProxy::invalidate()
m_page->process().removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_page->pageID());

didClose();
platformInvalidate();

m_page = nullptr;
}
@@ -157,6 +157,7 @@ class WebInspectorProxy : public API::ObjectImpl<API::Object::Type::Inspector>,
WebPageProxy* platformCreateInspectorPage();
void platformOpen();
void platformDidClose();
void platformInvalidate();
void platformBringToFront();
void platformHide();
bool platformIsFront();
@@ -4219,6 +4219,10 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
if (!m_keyEventQueue.isEmpty())
m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);

// The call to doneWithKeyEvent may close this WebPage.
// Protect against this being destroyed.
Ref<WebPageProxy> protect(*this);

m_pageClient.doneWithKeyEvent(event, handled);
if (handled)
break;
@@ -142,6 +142,10 @@ void WebInspectorProxy::platformDidClose()
}
}

void WebInspectorProxy::platformInvalidate()
{
}

void WebInspectorProxy::platformHide()
{
notImplemented();
@@ -168,6 +168,10 @@ void WebInspectorProxy::platformDidClose()
m_inspectorView = 0;
}

void WebInspectorProxy::platformInvalidate()
{
}

void WebInspectorProxy::platformHide()
{
notImplemented();
@@ -291,7 +291,11 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
if (m_isAttached || m_inspectorWindow)
return;

m_inspectorView = nil;
if (m_inspectorView) {
WebPageProxy* inspectorPage = toImpl(m_inspectorView.get().pageRef);
inspectorPage->close();
m_inspectorView = nil;
}

[m_inspectorProxyObjCAdapter close];
m_inspectorProxyObjCAdapter = nil;
@@ -544,6 +548,13 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
m_closeTimer.startOneShot(webViewCloseTimeout);
}

void WebInspectorProxy::platformInvalidate()
{
m_closeTimer.stop();

closeTimerFired();
}

void WebInspectorProxy::platformHide()
{
if (m_isAttached) {

0 comments on commit a25ad39

Please sign in to comment.