[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

yurys at chromium.org yurys at chromium.org
Wed Dec 22 12:41:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a25aa5a54dae2b2571ae5ec7e685d78ab323124d
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 27 10:04:58 2010 +0000

    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::inspectedPageDestroyed):
            (WebCore::InspectorController::close):
            * inspector/InspectorFrontendClient.h:
            * inspector/InspectorFrontendHost.cpp:
            (WebCore::InspectorFrontendHost::disconnectFromBackend): don't try to notify InspectorController
            that frontend closes if InspectorController triggered the action.
            * inspector/InspectorFrontendHost.h:
            * inspector/InspectorFrontendHost.idl:
            * inspector/front-end/InspectorFrontendHostStub.js:
            (.WebInspector.InspectorFrontendHostStub.prototype.disconnectFromBackend):
            * inspector/front-end/inspector.js:
            (WebInspector.disconnectFromBackend):
    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * src/InspectorFrontendClientImpl.cpp:
            (WebKit::InspectorFrontendClientImpl::disconnectFromBackend):
            * src/InspectorFrontendClientImpl.h:
    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * WebCoreSupport/InspectorClientGtk.cpp:
            (WebKit::notifyWebViewDestroyed):
            (WebKit::InspectorFrontendClient::destroyInspectorWindow):
            (WebKit::InspectorFrontendClient::closeWindow):
            (WebKit::InspectorFrontendClient::disconnectFromBackend):
            * WebCoreSupport/InspectorClientGtk.h:
    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * WebCoreSupport/WebInspectorClient.h:
            * WebCoreSupport/WebInspectorClient.mm:
            (WebInspectorFrontendClient::closeWindow):
            (WebInspectorFrontendClient::disconnectFromBackend):
            (-[WebInspectorWindowController windowShouldClose:]):
            (-[WebInspectorWindowController destroyInspectorView:]):
    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * WebCoreSupport/InspectorClientQt.cpp:
            (WebCore::InspectorClientQt::inspectorDestroyed):
            (WebCore::InspectorClientQt::openInspectorFrontend):
            (WebCore::InspectorClientQt::releaseFrontendPage):
            (WebCore::InspectorFrontendClientQt::closeWindow):
            (WebCore::InspectorFrontendClientQt::disconnectFromBackend):
            (WebCore::InspectorFrontendClientQt::destroyInspectorView):
            (WebCore::InspectorFrontendClientQt::inspectorClientDestroyed):
            * WebCoreSupport/InspectorClientQt.h:
    2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
            https://bugs.webkit.org/show_bug.cgi?id=44230
    
            * WebCoreSupport/WebInspectorClient.cpp:
            (WebInspectorFrontendClient::~WebInspectorFrontendClient):
            (WebInspectorFrontendClient::closeWindow):
            (WebInspectorFrontendClient::disconnectFromBackend):
            (WebInspectorFrontendClient::closeWindowWithoutNotifications):
            (WebInspectorFrontendClient::destroyInspectorView):
            * WebCoreSupport/WebInspectorClient.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5021df1..1d2ae63 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::inspectedPageDestroyed):
+        (WebCore::InspectorController::close):
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::disconnectFromBackend): don't try to notify InspectorController
+        that frontend closes if InspectorController triggered the action.
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        (.WebInspector.InspectorFrontendHostStub.prototype.disconnectFromBackend):
+        * inspector/front-end/inspector.js:
+        (WebInspector.disconnectFromBackend):
+
 2010-08-27  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r66188.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index ff1c2af..1f034b2 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -40,10 +40,9 @@ module core {
         [notify] void childNodeCountUpdated(out long id, out int newValue);
         [notify] void childNodeInserted(out long parentId, out long prevId, out Object node);
         [notify] void childNodeRemoved(out long parentId, out long id);
-        [notify] void close();
         [notify] void didCommitLoad();
         [notify] void evaluateForTestInFrontend(out long testCallId, out String script);
-        [notify] void inspectedPageDestroyed();
+        [notify] void disconnectFromBackend();
         [notify] void inspectedURLChanged(out String url);
         [notify] void monitoringXHRWasEnabled();
         [notify] void monitoringXHRWasDisabled();
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 7fb052c..b9c11c7 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -198,7 +198,7 @@ InspectorController::~InspectorController()
 void InspectorController::inspectedPageDestroyed()
 {
     if (m_frontend)
-        m_frontend->inspectedPageDestroyed();
+        m_frontend->disconnectFromBackend();
 
     hideHighlight();
 
@@ -537,7 +537,8 @@ void InspectorController::close()
 {
     if (!m_frontend)
         return;
-    m_frontend->close();
+    m_frontend->disconnectFromBackend();
+    disconnectFrontend();
 }
 
 void InspectorController::disconnectFrontend()
diff --git a/WebCore/inspector/InspectorFrontendClient.h b/WebCore/inspector/InspectorFrontendClient.h
index cbbbc53..31f52b7 100644
--- a/WebCore/inspector/InspectorFrontendClient.h
+++ b/WebCore/inspector/InspectorFrontendClient.h
@@ -53,6 +53,7 @@ public:
 
     virtual void bringToFront() = 0;
     virtual void closeWindow() = 0;
+    virtual void disconnectFromBackend() = 0;
 
     virtual void requestAttachWindow() = 0;
     virtual void requestDetachWindow() = 0;
diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp
index 8dc00ae..bc529ea 100644
--- a/WebCore/inspector/InspectorFrontendHost.cpp
+++ b/WebCore/inspector/InspectorFrontendHost.cpp
@@ -166,6 +166,14 @@ void InspectorFrontendHost::closeWindow()
     }
 }
 
+void InspectorFrontendHost::disconnectFromBackend()
+{
+    if (m_client) {
+        m_client->disconnectFromBackend();
+        disconnectClient(); // Disconnect from client.
+    }
+}
+
 void InspectorFrontendHost::bringToFront()
 {
     if (m_client)
diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h
index 4b343fd..d333893 100644
--- a/WebCore/inspector/InspectorFrontendHost.h
+++ b/WebCore/inspector/InspectorFrontendHost.h
@@ -62,6 +62,7 @@ public:
     void requestAttachWindow();
     void requestDetachWindow();
     void closeWindow();
+    void disconnectFromBackend();
     void bringToFront();
     void inspectedURLChanged(const String&);
 
diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl
index 0c7cf8b..6853c7d 100644
--- a/WebCore/inspector/InspectorFrontendHost.idl
+++ b/WebCore/inspector/InspectorFrontendHost.idl
@@ -34,6 +34,7 @@ module core {
     interface [Conditional=INSPECTOR] InspectorFrontendHost {
         void loaded();
         void closeWindow();
+        void disconnectFromBackend();
         void bringToFront();
         void inspectedURLChanged(in DOMString newURL);
 
diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
index c4e6bf4..07f392d 100644
--- a/WebCore/inspector/front-end/InspectorFrontendHostStub.js
+++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -64,6 +64,11 @@ WebInspector.InspectorFrontendHostStub.prototype = {
         this._windowVisible = false;
     },
 
+    disconnectFromBackend: function()
+    {
+        this._windowVisible = false;
+    },
+
     attach: function()
     {
     },
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index cf47dc6..012e67c 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -715,9 +715,9 @@ WebInspector.close = function(event)
     InspectorFrontendHost.closeWindow();
 }
 
-WebInspector.inspectedPageDestroyed = function()
+WebInspector.disconnectFromBackend = function()
 {
-    WebInspector.close();
+    InspectorFrontendHost.disconnectFromBackend();
 }
 
 WebInspector.documentMouseOver = function(event)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4e4c8e5..8558a33 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * src/InspectorFrontendClientImpl.cpp:
+        (WebKit::InspectorFrontendClientImpl::disconnectFromBackend):
+        * src/InspectorFrontendClientImpl.h:
+
 2010-08-27  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
index 46f2cb6..51864f1 100644
--- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -105,6 +105,11 @@ void InspectorFrontendClientImpl::closeWindow()
     m_client->closeWindow();
 }
 
+void InspectorFrontendClientImpl::disconnectFromBackend()
+{
+    m_client->closeWindow();
+}
+
 void InspectorFrontendClientImpl::requestAttachWindow()
 {
     m_client->requestDockWindow();
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.h b/WebKit/chromium/src/InspectorFrontendClientImpl.h
index 1507bf2..fc21f3e 100644
--- a/WebKit/chromium/src/InspectorFrontendClientImpl.h
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.h
@@ -61,6 +61,7 @@ public:
 
     virtual void bringToFront();
     virtual void closeWindow();
+    virtual void disconnectFromBackend();
 
     virtual void requestAttachWindow();
     virtual void requestDetachWindow();
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 18405fe..5001091 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        (WebKit::notifyWebViewDestroyed):
+        (WebKit::InspectorFrontendClient::destroyInspectorWindow):
+        (WebKit::InspectorFrontendClient::closeWindow):
+        (WebKit::InspectorFrontendClient::disconnectFromBackend):
+        * WebCoreSupport/InspectorClientGtk.h:
+
 2010-08-26  Yury Semikhatsky  <yurys at chromium.org>
 
         Unreviewed. Revert r66103 since Qt tests are failing.
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index aedf21f..c8b42d7 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -36,7 +36,7 @@ namespace WebKit {
 
 static void notifyWebViewDestroyed(WebKitWebView* webView, InspectorFrontendClient* inspectorFrontendClient)
 {
-    inspectorFrontendClient->destroyInspectorWindow();
+    inspectorFrontendClient->destroyInspectorWindow(true);
 }
 
 InspectorClient::InspectorClient(WebKitWebView* webView)
@@ -274,7 +274,7 @@ InspectorFrontendClient::~InspectorFrontendClient()
     ASSERT(!m_webInspector);
 }
 
-void InspectorFrontendClient::destroyInspectorWindow()
+void InspectorFrontendClient::destroyInspectorWindow(bool notifyInspectorController)
 {
     if (!m_webInspector)
         return;
@@ -284,7 +284,8 @@ void InspectorFrontendClient::destroyInspectorWindow()
     g_signal_handlers_disconnect_by_func(m_inspectorWebView, (gpointer)notifyWebViewDestroyed, (gpointer)this);
     m_inspectorWebView = 0;
 
-    core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
+    if (notifyInspectorController)
+        core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
 
     if (m_inspectorClient)
         m_inspectorClient->releaseFrontendPage();
@@ -326,7 +327,12 @@ void InspectorFrontendClient::bringToFront()
 
 void InspectorFrontendClient::closeWindow()
 {
-    destroyInspectorWindow();
+    destroyInspectorWindow(true);
+}
+
+void InspectorFrontendClient::disconnectFromBackend()
+{
+    destroyInspectorWindow(false);
 }
 
 void InspectorFrontendClient::attachWindow()
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
index 8b68405..08038f6 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
@@ -80,7 +80,7 @@ namespace WebKit {
 
         void disconnectInspectorClient() { m_inspectorClient = 0; }
 
-        void destroyInspectorWindow();
+        void destroyInspectorWindow(bool notifyInspectorController);
 
         virtual WTF::String localizedStringsURL();
 
@@ -88,6 +88,7 @@ namespace WebKit {
 
         virtual void bringToFront();
         virtual void closeWindow();
+        virtual void disconnectFromBackend();
 
         virtual void attachWindow();
         virtual void detachWindow();
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 179ba10..5369081 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * WebCoreSupport/WebInspectorClient.h:
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorFrontendClient::closeWindow):
+        (WebInspectorFrontendClient::disconnectFromBackend):
+        (-[WebInspectorWindowController windowShouldClose:]):
+        (-[WebInspectorWindowController destroyInspectorView:]):
+
 2010-08-26  Yury Semikhatsky  <yurys at chromium.org>
 
         Unreviewed. Revert r66103 since Qt tests are failing.
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index d33e3b9..75a3cc6 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -84,6 +84,7 @@ public:
 
     virtual void bringToFront();
     virtual void closeWindow();
+    virtual void disconnectFromBackend();
 
     virtual void attachWindow();
     virtual void detachWindow();
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 7cae8fc..d4d0213 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -66,7 +66,7 @@ using namespace WebCore;
 - (void)setFrontendClient:(WebInspectorFrontendClient*)frontendClient;
 - (void)setInspectorClient:(WebInspectorClient*)inspectorClient;
 - (void)setAttachedWindowHeight:(unsigned)height;
-- (void)destroyInspectorView;
+- (void)destroyInspectorView:(bool)notifyInspectorController;
 @end
 
 #pragma mark -
@@ -169,7 +169,12 @@ void WebInspectorFrontendClient::bringToFront()
 
 void WebInspectorFrontendClient::closeWindow()
 {
-    [m_windowController.get() destroyInspectorView];
+    [m_windowController.get() destroyInspectorView:true];
+}
+
+void WebInspectorFrontendClient::disconnectFromBackend()
+{
+    [m_windowController.get() destroyInspectorView:false];
 }
 
 void WebInspectorFrontendClient::attachWindow()
@@ -308,7 +313,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
 
 - (BOOL)windowShouldClose:(id)sender
 {
-    [self destroyInspectorView];
+    [self destroyInspectorView:true];
 
     return YES;
 }
@@ -439,7 +444,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
     [frameView setFrame:frameViewRect];
 }
 
-- (void)destroyInspectorView
+- (void)destroyInspectorView:(bool)notifyInspectorController
 {
     if (_destroyingInspectorView)
         return;
@@ -450,10 +455,12 @@ void WebInspectorFrontendClient::updateWindowTitle() const
 
     _visible = NO;
 
-    if (Page* inspectedPage = [_inspectedWebView page])
-        inspectedPage->inspectorController()->disconnectFrontend();
+    if (notifyInspectorController) {
+        if (Page* inspectedPage = [_inspectedWebView page])
+            inspectedPage->inspectorController()->disconnectFrontend();
 
-    _inspectorClient->releaseFrontendPage();
+        _inspectorClient->releaseFrontendPage();
+    }
 
     [_webView close];
 }
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index bb34a39..73c1cfc 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::inspectorDestroyed):
+        (WebCore::InspectorClientQt::openInspectorFrontend):
+        (WebCore::InspectorClientQt::releaseFrontendPage):
+        (WebCore::InspectorFrontendClientQt::closeWindow):
+        (WebCore::InspectorFrontendClientQt::disconnectFromBackend):
+        (WebCore::InspectorFrontendClientQt::destroyInspectorView):
+        (WebCore::InspectorFrontendClientQt::inspectorClientDestroyed):
+        * WebCoreSupport/InspectorClientQt.h:
+
 2010-08-26  Girish Ramakrishnan  <girish at forwardbias.in>
 
         Reviewed by Antonio Gomes.
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index e13f6c3..8c33ac0 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -100,6 +100,8 @@ InspectorClientQt::InspectorClientQt(QWebPage* page)
 
 void InspectorClientQt::inspectorDestroyed()
 {
+    if (m_frontendClient)
+        m_frontendClient->inspectorClientDestroyed();
     delete this;
 }
 
@@ -131,13 +133,15 @@ void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
     m_inspectedWebPage->d->inspectorFrontend = inspectorView;
     inspector->d->setFrontend(inspectorView);
 
-    inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this));
+    m_frontendClient = new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this);
+    inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(m_frontendClient);
     m_frontendWebPage = inspectorPage;
 }
 
 void InspectorClientQt::releaseFrontendPage()
 {
     m_frontendWebPage = 0;
+    m_frontendClient = 0;
 }
 
 void InspectorClientQt::highlight(Node*)
@@ -275,19 +279,12 @@ void InspectorFrontendClientQt::bringToFront()
 
 void InspectorFrontendClientQt::closeWindow()
 {
-    if (m_destroyingInspectorView)
-        return;
-    m_destroyingInspectorView = true;
-
-    // Clear reference from QWebInspector to the frontend view.
-    m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0);
-#if ENABLE(INSPECTOR)
-    m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
-#endif
-    m_inspectorClient->releaseFrontendPage();
+    destroyInspectorView(true);
+}
 
-    // Clear pointer before deleting WebView to avoid recursive calls to its destructor.
-    OwnPtr<QWebView> inspectorView = m_inspectorView.release();
+void InspectorFrontendClientQt::disconnectFromBackend()
+{
+    destroyInspectorView(false);
 }
 
 void InspectorFrontendClientQt::attachWindow()
@@ -319,6 +316,31 @@ void InspectorFrontendClientQt::updateWindowTitle()
     }
 }
 
+void InspectorFrontendClientQt::destroyInspectorView(bool notifyInspectorController)
+{
+    if (m_destroyingInspectorView)
+        return;
+    m_destroyingInspectorView = true;
+
+    // Clear reference from QWebInspector to the frontend view.
+    m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0);
+
+#if ENABLE(INSPECTOR)
+    if (notifyInspectorController)
+        m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
+#endif
+    if (m_inspectorClient)
+        m_inspectorClient->releaseFrontendPage();
+
+    // Clear pointer before deleting WebView to avoid recursive calls to its destructor.
+    OwnPtr<QWebView> inspectorView = m_inspectorView.release();
+}
+
+void InspectorFrontendClientQt::inspectorClientDestroyed()
+{
+    m_inspectorClient = 0;
+}
+
 }
 
 #include "InspectorClientQt.moc"
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 9526c88..e0ee810 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -41,6 +41,7 @@ class QWebPage;
 class QWebView;
 
 namespace WebCore {
+class InspectorFrontendClientQt;
 class Node;
 class Page;
 
@@ -65,6 +66,7 @@ public:
 private:
     QWebPage* m_inspectedWebPage;
     QWebPage* m_frontendWebPage;
+    InspectorFrontendClientQt* m_frontendClient;
 };
 
 class InspectorFrontendClientQt : public InspectorFrontendClientLocal {
@@ -79,6 +81,7 @@ public:
 
     virtual void bringToFront();
     virtual void closeWindow();
+    virtual void disconnectFromBackend();
 
     virtual void attachWindow();
     virtual void detachWindow();
@@ -87,8 +90,11 @@ public:
 
     virtual void inspectedURLChanged(const String& newURL);
 
+    void inspectorClientDestroyed();
+
 private:
     void updateWindowTitle();
+    void destroyInspectorView(bool notifyInspectorController);
     QWebPage* m_inspectedWebPage;
     OwnPtr<QWebView> m_inspectorView;
     QString m_inspectedURL;
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 5940dfe..49eb148 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-27  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=44230
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::~WebInspectorFrontendClient):
+        (WebInspectorFrontendClient::closeWindow):
+        (WebInspectorFrontendClient::disconnectFromBackend):
+        (WebInspectorFrontendClient::closeWindowWithoutNotifications):
+        (WebInspectorFrontendClient::destroyInspectorView):
+        * WebCoreSupport/WebInspectorClient.h:
+
 2010-08-26  Yury Semikhatsky  <yurys at chromium.org>
 
         Unreviewed. Revert r66103 since Qt tests are failing.
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 34fb827..1b79dde 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -228,7 +228,7 @@ WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView
 
 WebInspectorFrontendClient::~WebInspectorFrontendClient()
 {
-    destroyInspectorView();
+    destroyInspectorView(true);
 }
 
 void WebInspectorFrontendClient::frontendLoaded()
@@ -260,7 +260,12 @@ void WebInspectorFrontendClient::bringToFront()
 
 void WebInspectorFrontendClient::closeWindow()
 {
-    destroyInspectorView();
+    destroyInspectorView(true);
+}
+
+void WebInspectorFrontendClient::disconnectFromBackend()
+{
+    destroyInspectorView(false);
 }
 
 void WebInspectorFrontendClient::attachWindow()
@@ -344,8 +349,6 @@ void WebInspectorFrontendClient::closeWindowWithoutNotifications()
     HWND hostWindow;
     if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
         SendMessage(hostWindow, WM_SIZE, 0, 0);
-
-    m_inspectorClient->updateHighlight();
 }
 
 void WebInspectorFrontendClient::showWindowWithoutNotifications()
@@ -397,16 +400,20 @@ void WebInspectorFrontendClient::showWindowWithoutNotifications()
     m_inspectorClient->updateHighlight();
 }
 
-void WebInspectorFrontendClient::destroyInspectorView()
+void WebInspectorFrontendClient::destroyInspectorView(bool notifyInspectorController)
 {
     if (m_destroyingInspectorView)
         return;
     m_destroyingInspectorView = true;
 
-    m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
 
     closeWindowWithoutNotifications();
-    m_inspectorClient->frontendClosing();
+
+    if (notifyInspectorController) {
+        m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
+        m_inspectorClient->updateHighlight();
+        m_inspectorClient->frontendClosing();
+    }
     ::DestroyWindow(m_frontendHwnd);
 }
 
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 4da3984..0c38247 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -93,6 +93,7 @@ public:
     
     virtual void bringToFront();
     virtual void closeWindow();
+    virtual void disconnectFromBackend();
     
     virtual void attachWindow();
     virtual void detachWindow();
@@ -106,7 +107,7 @@ private:
     void closeWindowWithoutNotifications();
     void showWindowWithoutNotifications();
 
-    void destroyInspectorView();
+    void destroyInspectorView(bool notifyInspectorController);
 
     void updateWindowTitle();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list