Changeset 177459 in webkit


Ignore:
Timestamp:
Dec 17, 2014 1:19:21 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Joseph Pecoraro <Joseph Pecoraro> 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.

Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r177455 r177459  
     12014-12-17  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: [Mac] Occosional Crashes Closing Inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=139740
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UIProcess/WebPageProxy.cpp:
     9        (WebKit::WebPageProxy::didReceiveEvent):
     10        The WebPageProxy could have gotten destroyed in handling (e.g. keyboard shortcut
     11        to close the Inspector Window), so protect the object to avoid destruction
     12        during handling.
     13
     14        * UIProcess/WebInspectorProxy.h:
     15        * UIProcess/WebPageProxy.cpp:
     16        Add platformInvalidate opportunity for the platform to do invalidation work.
     17
     18        * UIProcess/efl/WebInspectorProxyEfl.cpp:
     19        (WebKit::WebInspectorProxy::platformInvalidate):
     20        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
     21        (WebKit::WebInspectorProxy::platformInvalidate):
     22        Empty implementations, these ports do not need to do anything.
     23
     24        * UIProcess/WebInspectorProxy.h:
     25        * UIProcess/mac/WebInspectorProxyMac.mm:
     26        (WebKit::WebInspectorProxy::closeTimerFired):
     27        (WebKit::WebInspectorProxy::platformDidClose):
     28        (WebKit::WebInspectorProxy::platformInvalidate):
     29        When closing / invalidating make sure we close the WKView to clear client
     30        for any delayed callbacks.
     31
    1322014-12-17  Chris Dumez  <cdumez@apple.com>
    233
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp

    r174902 r177459  
    171171
    172172    didClose();
     173    platformInvalidate();
    173174
    174175    m_page = nullptr;
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h

    r174327 r177459  
    158158    void platformOpen();
    159159    void platformDidClose();
     160    void platformInvalidate();
    160161    void platformBringToFront();
    161162    void platformHide();
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r177427 r177459  
    42204220            m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
    42214221
     4222        // The call to doneWithKeyEvent may close this WebPage.
     4223        // Protect against this being destroyed.
     4224        Ref<WebPageProxy> protect(*this);
     4225
    42224226        m_pageClient.doneWithKeyEvent(event, handled);
    42234227        if (handled)
  • trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp

    r174820 r177459  
    143143}
    144144
     145void WebInspectorProxy::platformInvalidate()
     146{
     147}
     148
    145149void WebInspectorProxy::platformHide()
    146150{
  • trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp

    r174327 r177459  
    169169}
    170170
     171void WebInspectorProxy::platformInvalidate()
     172{
     173}
     174
    171175void WebInspectorProxy::platformHide()
    172176{
  • trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

    r177309 r177459  
    292292        return;
    293293
    294     m_inspectorView = nil;
     294    if (m_inspectorView) {
     295        WebPageProxy* inspectorPage = toImpl(m_inspectorView.get().pageRef);
     296        inspectorPage->close();
     297        m_inspectorView = nil;
     298    }
    295299
    296300    [m_inspectorProxyObjCAdapter close];
     
    545549}
    546550
     551void WebInspectorProxy::platformInvalidate()
     552{
     553    m_closeTimer.stop();
     554
     555    closeTimerFired();
     556}
     557
    547558void WebInspectorProxy::platformHide()
    548559{
Note: See TracChangeset for help on using the changeset viewer.