2011-04-20 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2011 23:41:52 +0000 (23:41 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2011 23:41:52 +0000 (23:41 +0000)
        Reviewed by Sam Weinig.

        Reproducible crash under WebPageProxy::didReceiveEvent
        https://bugs.webkit.org/show_bug.cgi?id=59036
        <rdar://problem/9252083>

        * UIProcess/API/mac/WKView.mm:
        (-[WKView _resendKeyDownEvent:]): Protect against self-destruction
        when re-dispatching the event.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::createWebPage): Fixed a type mismatch
        I noticed while debugging.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84434 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/WebProcessProxy.cpp

index 5fc9eb2..ac7b95c 100644 (file)
@@ -1,3 +1,18 @@
+2011-04-20  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Reproducible crash under WebPageProxy::didReceiveEvent
+        https://bugs.webkit.org/show_bug.cgi?id=59036
+        <rdar://problem/9252083>
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _resendKeyDownEvent:]): Protect against self-destruction
+        when re-dispatching the event.        
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::createWebPage): Fixed a type mismatch
+        I noticed while debugging.
+
 2011-04-20  Timothy Hatcher  <timothy@apple.com>
 
         Make the Web Insepctor come to the front when a breakpoint is hit.
index 80345f7..9fa1f3d 100644 (file)
@@ -1987,6 +1987,9 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
 
 - (void)_resendKeyDownEvent:(NSEvent *)event
 {
+    // resending the event may destroy this WKView
+    RetainPtr<WKView> protect(self);
+
     ASSERT(!_data->_keyDownEventBeingResent);
     _data->_keyDownEventBeingResent = event;
     [NSApp _setCurrentEvent:event];
index a8ae574..42cac88 100644 (file)
@@ -169,7 +169,7 @@ PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient* pageClient,
 {
     ASSERT(context->process() == this);
 
-    unsigned pageID = generatePageID();
+    uint64_t pageID = generatePageID();
     RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, this, pageGroup, pageID);
     m_pageMap.set(pageID, webPage.get());
     return webPage.release();