Skip to content
Permalink
Browse files
REGRESSION(r196183): [GTK] Broke TestInspector
https://bugs.webkit.org/show_bug.cgi?id=153945

Reviewed by Michael Catanzaro.

When the inspector view is detached and not added to a window,
which happens when it's closed, the inspector view is destroyed
because it doesn't have a parent anymore. When the inspector view
is destroyed we notify the web process that the inspector was
closed. Before r196183 this was not a problem, because the call to
WebInspectorProxy::didClose() from platformDetach() returned early
because WebInspectorProxy::didClose() had already set
m_inspectorPage to nullptr. In r196183 m_inspectorPage is set to
nullptr after platformDetach(), so we end up trying to detach the
inpector view again. To prevent this cycle, we should disconnect
the destroyed signal handler from the inspector view when
platformDetach() is called from WebInspectorProxy::didClose().

* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformDetach):

Canonical link: https://commits.webkit.org/172170@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Feb 10, 2016
1 parent 5e7717a commit 376e7bb37ae10c816112a132f2bed38697fd7add
Showing with 31 additions and 1 deletion.
  1. +23 −0 Source/WebKit2/ChangeLog
  2. +8 −1 Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp
@@ -1,3 +1,26 @@
2016-02-09 Carlos Garcia Campos <cgarcia@igalia.com>

REGRESSION(r196183): [GTK] Broke TestInspector
https://bugs.webkit.org/show_bug.cgi?id=153945

Reviewed by Michael Catanzaro.

When the inspector view is detached and not added to a window,
which happens when it's closed, the inspector view is destroyed
because it doesn't have a parent anymore. When the inspector view
is destroyed we notify the web process that the inspector was
closed. Before r196183 this was not a problem, because the call to
WebInspectorProxy::didClose() from platformDetach() returned early
because WebInspectorProxy::didClose() had already set
m_inspectorPage to nullptr. In r196183 m_inspectorPage is set to
nullptr after platformDetach(), so we end up trying to detach the
inpector view again. To prevent this cycle, we should disconnect
the destroyed signal handler from the inspector view when
platformDetach() is called from WebInspectorProxy::didClose().

* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformDetach):

2016-02-09 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r196341.
@@ -319,8 +319,15 @@ void WebInspectorProxy::platformDetach()
gtk_container_remove(GTK_CONTAINER(parent), m_inspectorView);
}

if (!m_isVisible)
// Return early if we are not visible. This means the inspector was closed while attached
// and we should not create and show the inspector window.
if (!m_isVisible) {
// The inspector view will be destroyed, but we don't need to notify the web process to close the
// inspector in this case, since it's already closed.
g_signal_handlers_disconnect_by_func(m_inspectorView, reinterpret_cast<void*>(inspectorViewDestroyed), this);
m_inspectorView = nullptr;
return;
}

createInspectorWindow();
}

0 comments on commit 376e7bb

Please sign in to comment.