Changeset 66198 in webkit


Ignore:
Timestamp:
Aug 27, 2010 3:04:58 AM (14 years ago)
Author:
yurys@chromium.org
Message:

2010-08-27 Yury Semikhatsky <yurys@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@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@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@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@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@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:
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66197 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * inspector/Inspector.idl:
     9        * inspector/InspectorController.cpp:
     10        (WebCore::InspectorController::inspectedPageDestroyed):
     11        (WebCore::InspectorController::close):
     12        * inspector/InspectorFrontendClient.h:
     13        * inspector/InspectorFrontendHost.cpp:
     14        (WebCore::InspectorFrontendHost::disconnectFromBackend): don't try to notify InspectorController
     15        that frontend closes if InspectorController triggered the action.
     16        * inspector/InspectorFrontendHost.h:
     17        * inspector/InspectorFrontendHost.idl:
     18        * inspector/front-end/InspectorFrontendHostStub.js:
     19        (.WebInspector.InspectorFrontendHostStub.prototype.disconnectFromBackend):
     20        * inspector/front-end/inspector.js:
     21        (WebInspector.disconnectFromBackend):
     22
    1232010-08-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    224
  • trunk/WebCore/inspector/Inspector.idl

    r66117 r66198  
    4141        [notify] void childNodeInserted(out long parentId, out long prevId, out Object node);
    4242        [notify] void childNodeRemoved(out long parentId, out long id);
    43         [notify] void close();
    4443        [notify] void didCommitLoad();
    4544        [notify] void evaluateForTestInFrontend(out long testCallId, out String script);
    46         [notify] void inspectedPageDestroyed();
     45        [notify] void disconnectFromBackend();
    4746        [notify] void inspectedURLChanged(out String url);
    4847        [notify] void monitoringXHRWasEnabled();
  • trunk/WebCore/inspector/InspectorController.cpp

    r66106 r66198  
    199199{
    200200    if (m_frontend)
    201         m_frontend->inspectedPageDestroyed();
     201        m_frontend->disconnectFromBackend();
    202202
    203203    hideHighlight();
     
    538538    if (!m_frontend)
    539539        return;
    540     m_frontend->close();
     540    m_frontend->disconnectFromBackend();
     541    disconnectFrontend();
    541542}
    542543
  • trunk/WebCore/inspector/InspectorFrontendClient.h

    r66106 r66198  
    5454    virtual void bringToFront() = 0;
    5555    virtual void closeWindow() = 0;
     56    virtual void disconnectFromBackend() = 0;
    5657
    5758    virtual void requestAttachWindow() = 0;
  • trunk/WebCore/inspector/InspectorFrontendHost.cpp

    r66106 r66198  
    167167}
    168168
     169void InspectorFrontendHost::disconnectFromBackend()
     170{
     171    if (m_client) {
     172        m_client->disconnectFromBackend();
     173        disconnectClient(); // Disconnect from client.
     174    }
     175}
     176
    169177void InspectorFrontendHost::bringToFront()
    170178{
  • trunk/WebCore/inspector/InspectorFrontendHost.h

    r66106 r66198  
    6363    void requestDetachWindow();
    6464    void closeWindow();
     65    void disconnectFromBackend();
    6566    void bringToFront();
    6667    void inspectedURLChanged(const String&);
  • trunk/WebCore/inspector/InspectorFrontendHost.idl

    r66106 r66198  
    3535        void loaded();
    3636        void closeWindow();
     37        void disconnectFromBackend();
    3738        void bringToFront();
    3839        void inspectedURLChanged(in DOMString newURL);
  • trunk/WebCore/inspector/front-end/InspectorFrontendHostStub.js

    r66106 r66198  
    6565    },
    6666
     67    disconnectFromBackend: function()
     68    {
     69        this._windowVisible = false;
     70    },
     71
    6772    attach: function()
    6873    {
  • trunk/WebCore/inspector/front-end/inspector.js

    r66117 r66198  
    716716}
    717717
    718 WebInspector.inspectedPageDestroyed = function()
    719 {
    720     WebInspector.close();
     718WebInspector.disconnectFromBackend = function()
     719{
     720    InspectorFrontendHost.disconnectFromBackend();
    721721}
    722722
  • trunk/WebKit/chromium/ChangeLog

    r66194 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * src/InspectorFrontendClientImpl.cpp:
     9        (WebKit::InspectorFrontendClientImpl::disconnectFromBackend):
     10        * src/InspectorFrontendClientImpl.h:
     11
    1122010-08-27  Kent Tamura  <tkent@chromium.org>
    213
  • trunk/WebKit/chromium/src/InspectorFrontendClientImpl.cpp

    r66106 r66198  
    106106}
    107107
     108void InspectorFrontendClientImpl::disconnectFromBackend()
     109{
     110    m_client->closeWindow();
     111}
     112
    108113void InspectorFrontendClientImpl::requestAttachWindow()
    109114{
  • trunk/WebKit/chromium/src/InspectorFrontendClientImpl.h

    r66106 r66198  
    6262    virtual void bringToFront();
    6363    virtual void closeWindow();
     64    virtual void disconnectFromBackend();
    6465
    6566    virtual void requestAttachWindow();
  • trunk/WebKit/gtk/ChangeLog

    r66106 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * WebCoreSupport/InspectorClientGtk.cpp:
     9        (WebKit::notifyWebViewDestroyed):
     10        (WebKit::InspectorFrontendClient::destroyInspectorWindow):
     11        (WebKit::InspectorFrontendClient::closeWindow):
     12        (WebKit::InspectorFrontendClient::disconnectFromBackend):
     13        * WebCoreSupport/InspectorClientGtk.h:
     14
    1152010-08-26  Yury Semikhatsky  <yurys@chromium.org>
    216
  • trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp

    r66106 r66198  
    3737static void notifyWebViewDestroyed(WebKitWebView* webView, InspectorFrontendClient* inspectorFrontendClient)
    3838{
    39     inspectorFrontendClient->destroyInspectorWindow();
     39    inspectorFrontendClient->destroyInspectorWindow(true);
    4040}
    4141
     
    275275}
    276276
    277 void InspectorFrontendClient::destroyInspectorWindow()
     277void InspectorFrontendClient::destroyInspectorWindow(bool notifyInspectorController)
    278278{
    279279    if (!m_webInspector)
     
    285285    m_inspectorWebView = 0;
    286286
    287     core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
     287    if (notifyInspectorController)
     288        core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
    288289
    289290    if (m_inspectorClient)
     
    327328void InspectorFrontendClient::closeWindow()
    328329{
    329     destroyInspectorWindow();
     330    destroyInspectorWindow(true);
     331}
     332
     333void InspectorFrontendClient::disconnectFromBackend()
     334{
     335    destroyInspectorWindow(false);
    330336}
    331337
  • trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h

    r66106 r66198  
    8181        void disconnectInspectorClient() { m_inspectorClient = 0; }
    8282
    83         void destroyInspectorWindow();
     83        void destroyInspectorWindow(bool notifyInspectorController);
    8484
    8585        virtual WTF::String localizedStringsURL();
     
    8989        virtual void bringToFront();
    9090        virtual void closeWindow();
     91        virtual void disconnectFromBackend();
    9192
    9293        virtual void attachWindow();
  • trunk/WebKit/mac/ChangeLog

    r66106 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * WebCoreSupport/WebInspectorClient.h:
     9        * WebCoreSupport/WebInspectorClient.mm:
     10        (WebInspectorFrontendClient::closeWindow):
     11        (WebInspectorFrontendClient::disconnectFromBackend):
     12        (-[WebInspectorWindowController windowShouldClose:]):
     13        (-[WebInspectorWindowController destroyInspectorView:]):
     14
    1152010-08-26  Yury Semikhatsky  <yurys@chromium.org>
    216
  • trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h

    r66106 r66198  
    8585    virtual void bringToFront();
    8686    virtual void closeWindow();
     87    virtual void disconnectFromBackend();
    8788
    8889    virtual void attachWindow();
  • trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

    r66106 r66198  
    6767- (void)setInspectorClient:(WebInspectorClient*)inspectorClient;
    6868- (void)setAttachedWindowHeight:(unsigned)height;
    69 - (void)destroyInspectorView;
     69- (void)destroyInspectorView:(bool)notifyInspectorController;
    7070@end
    7171
     
    170170void WebInspectorFrontendClient::closeWindow()
    171171{
    172     [m_windowController.get() destroyInspectorView];
     172    [m_windowController.get() destroyInspectorView:true];
     173}
     174
     175void WebInspectorFrontendClient::disconnectFromBackend()
     176{
     177    [m_windowController.get() destroyInspectorView:false];
    173178}
    174179
     
    309314- (BOOL)windowShouldClose:(id)sender
    310315{
    311     [self destroyInspectorView];
     316    [self destroyInspectorView:true];
    312317
    313318    return YES;
     
    440445}
    441446
    442 - (void)destroyInspectorView
     447- (void)destroyInspectorView:(bool)notifyInspectorController
    443448{
    444449    if (_destroyingInspectorView)
     
    451456    _visible = NO;
    452457
    453     if (Page* inspectedPage = [_inspectedWebView page])
    454         inspectedPage->inspectorController()->disconnectFrontend();
    455 
    456     _inspectorClient->releaseFrontendPage();
     458    if (notifyInspectorController) {
     459        if (Page* inspectedPage = [_inspectedWebView page])
     460            inspectedPage->inspectorController()->disconnectFrontend();
     461
     462        _inspectorClient->releaseFrontendPage();
     463    }
    457464
    458465    [_webView close];
  • trunk/WebKit/qt/ChangeLog

    r66182 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * WebCoreSupport/InspectorClientQt.cpp:
     9        (WebCore::InspectorClientQt::inspectorDestroyed):
     10        (WebCore::InspectorClientQt::openInspectorFrontend):
     11        (WebCore::InspectorClientQt::releaseFrontendPage):
     12        (WebCore::InspectorFrontendClientQt::closeWindow):
     13        (WebCore::InspectorFrontendClientQt::disconnectFromBackend):
     14        (WebCore::InspectorFrontendClientQt::destroyInspectorView):
     15        (WebCore::InspectorFrontendClientQt::inspectorClientDestroyed):
     16        * WebCoreSupport/InspectorClientQt.h:
     17
    1182010-08-26  Girish Ramakrishnan  <girish@forwardbias.in>
    219
  • trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp

    r66106 r66198  
    101101void InspectorClientQt::inspectorDestroyed()
    102102{
     103    if (m_frontendClient)
     104        m_frontendClient->inspectorClientDestroyed();
    103105    delete this;
    104106}
     
    132134    inspector->d->setFrontend(inspectorView);
    133135
    134     inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this));
     136    m_frontendClient = new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this);
     137    inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(m_frontendClient);
    135138    m_frontendWebPage = inspectorPage;
    136139}
     
    139142{
    140143    m_frontendWebPage = 0;
     144    m_frontendClient = 0;
    141145}
    142146
     
    276280void InspectorFrontendClientQt::closeWindow()
    277281{
     282    destroyInspectorView(true);
     283}
     284
     285void InspectorFrontendClientQt::disconnectFromBackend()
     286{
     287    destroyInspectorView(false);
     288}
     289
     290void InspectorFrontendClientQt::attachWindow()
     291{
     292    notImplemented();
     293}
     294
     295void InspectorFrontendClientQt::detachWindow()
     296{
     297    notImplemented();
     298}
     299
     300void InspectorFrontendClientQt::setAttachedWindowHeight(unsigned)
     301{
     302    notImplemented();
     303}
     304
     305void InspectorFrontendClientQt::inspectedURLChanged(const String& newURL)
     306{
     307    m_inspectedURL = newURL;
     308    updateWindowTitle();
     309}
     310
     311void InspectorFrontendClientQt::updateWindowTitle()
     312{
     313    if (m_inspectedWebPage->d->inspector) {
     314        QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
     315        m_inspectedWebPage->d->inspector->setWindowTitle(caption);
     316    }
     317}
     318
     319void InspectorFrontendClientQt::destroyInspectorView(bool notifyInspectorController)
     320{
    278321    if (m_destroyingInspectorView)
    279322        return;
     
    282325    // Clear reference from QWebInspector to the frontend view.
    283326    m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0);
     327
    284328#if ENABLE(INSPECTOR)
    285     m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
     329    if (notifyInspectorController)
     330        m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
    286331#endif
    287     m_inspectorClient->releaseFrontendPage();
     332    if (m_inspectorClient)
     333        m_inspectorClient->releaseFrontendPage();
    288334
    289335    // Clear pointer before deleting WebView to avoid recursive calls to its destructor.
     
    291337}
    292338
    293 void InspectorFrontendClientQt::attachWindow()
    294 {
    295     notImplemented();
    296 }
    297 
    298 void InspectorFrontendClientQt::detachWindow()
    299 {
    300     notImplemented();
    301 }
    302 
    303 void InspectorFrontendClientQt::setAttachedWindowHeight(unsigned)
    304 {
    305     notImplemented();
    306 }
    307 
    308 void InspectorFrontendClientQt::inspectedURLChanged(const String& newURL)
    309 {
    310     m_inspectedURL = newURL;
    311     updateWindowTitle();
    312 }
    313 
    314 void InspectorFrontendClientQt::updateWindowTitle()
    315 {
    316     if (m_inspectedWebPage->d->inspector) {
    317         QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
    318         m_inspectedWebPage->d->inspector->setWindowTitle(caption);
    319     }
     339void InspectorFrontendClientQt::inspectorClientDestroyed()
     340{
     341    m_inspectorClient = 0;
    320342}
    321343
  • trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h

    r66106 r66198  
    4242
    4343namespace WebCore {
     44class InspectorFrontendClientQt;
    4445class Node;
    4546class Page;
     
    6667    QWebPage* m_inspectedWebPage;
    6768    QWebPage* m_frontendWebPage;
     69    InspectorFrontendClientQt* m_frontendClient;
    6870};
    6971
     
    8082    virtual void bringToFront();
    8183    virtual void closeWindow();
     84    virtual void disconnectFromBackend();
    8285
    8386    virtual void attachWindow();
     
    8891    virtual void inspectedURLChanged(const String& newURL);
    8992
     93    void inspectorClientDestroyed();
     94
    9095private:
    9196    void updateWindowTitle();
     97    void destroyInspectorView(bool notifyInspectorController);
    9298    QWebPage* m_inspectedWebPage;
    9399    OwnPtr<QWebView> m_inspectorView;
  • trunk/WebKit/win/ChangeLog

    r66106 r66198  
     12010-08-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
     6        https://bugs.webkit.org/show_bug.cgi?id=44230
     7
     8        * WebCoreSupport/WebInspectorClient.cpp:
     9        (WebInspectorFrontendClient::~WebInspectorFrontendClient):
     10        (WebInspectorFrontendClient::closeWindow):
     11        (WebInspectorFrontendClient::disconnectFromBackend):
     12        (WebInspectorFrontendClient::closeWindowWithoutNotifications):
     13        (WebInspectorFrontendClient::destroyInspectorView):
     14        * WebCoreSupport/WebInspectorClient.h:
     15
    1162010-08-26  Yury Semikhatsky  <yurys@chromium.org>
    217
  • trunk/WebKit/win/WebCoreSupport/WebInspectorClient.cpp

    r66106 r66198  
    229229WebInspectorFrontendClient::~WebInspectorFrontendClient()
    230230{
    231     destroyInspectorView();
     231    destroyInspectorView(true);
    232232}
    233233
     
    261261void WebInspectorFrontendClient::closeWindow()
    262262{
    263     destroyInspectorView();
     263    destroyInspectorView(true);
     264}
     265
     266void WebInspectorFrontendClient::disconnectFromBackend()
     267{
     268    destroyInspectorView(false);
    264269}
    265270
     
    345350    if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
    346351        SendMessage(hostWindow, WM_SIZE, 0, 0);
    347 
    348     m_inspectorClient->updateHighlight();
    349352}
    350353
     
    398401}
    399402
    400 void WebInspectorFrontendClient::destroyInspectorView()
     403void WebInspectorFrontendClient::destroyInspectorView(bool notifyInspectorController)
    401404{
    402405    if (m_destroyingInspectorView)
     
    404407    m_destroyingInspectorView = true;
    405408
    406     m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
    407409
    408410    closeWindowWithoutNotifications();
    409     m_inspectorClient->frontendClosing();
     411
     412    if (notifyInspectorController) {
     413        m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
     414        m_inspectorClient->updateHighlight();
     415        m_inspectorClient->frontendClosing();
     416    }
    410417    ::DestroyWindow(m_frontendHwnd);
    411418}
  • trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h

    r66106 r66198  
    9494    virtual void bringToFront();
    9595    virtual void closeWindow();
     96    virtual void disconnectFromBackend();
    9697   
    9798    virtual void attachWindow();
     
    107108    void showWindowWithoutNotifications();
    108109
    109     void destroyInspectorView();
     110    void destroyInspectorView(bool notifyInspectorController);
    110111
    111112    void updateWindowTitle();
Note: See TracChangeset for help on using the changeset viewer.