Changeset 64155 in webkit


Ignore:
Timestamp:
Jul 27, 2010 2:06:35 PM (14 years ago)
Author:
Adam Roben
Message:

Fix PageClient ownership in WebPageProxy

WKView now owns the PageClient, similar to how things work on Windows
(where the WebView is the PageClient).

Fixes <http://webkit.org/b/40185> WebPageProxy should keep a weak
reference to the PageClient

Reviewed by Anders Carlsson.

  • UIProcess/API/mac/WKView.mm:

(-[WKView initWithFrame:pageNamespaceRef:]): Store the PageClientImpl
on our WKViewData object and pass it to the WebPageProxy.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::setPageClient):

  • UIProcess/WebPageProxy.h:

Removed Mac-specific code that put the PageClient in an OwnPtr. We now
store it in a bare pointer just like on Windows.

Location:
trunk/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r64154 r64155  
     12010-07-27  Adam Roben  <aroben@apple.com>
     2
     3        Fix PageClient ownership in WebPageProxy
     4
     5        WKView now owns the PageClient, similar to how things work on Windows
     6        (where the WebView is the PageClient).
     7
     8        Fixes <http://webkit.org/b/40185> WebPageProxy should keep a weak
     9        reference to the PageClient
     10
     11        Reviewed by Anders Carlsson.
     12
     13        * UIProcess/API/mac/WKView.mm:
     14        (-[WKView initWithFrame:pageNamespaceRef:]): Store the PageClientImpl
     15        on our WKViewData object and pass it to the WebPageProxy.
     16
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::setPageClient):
     19        * UIProcess/WebPageProxy.h:
     20        Removed Mac-specific code that put the PageClient in an OwnPtr. We now
     21        store it in a bare pointer just like on Windows.
     22
    1232010-07-27  Anders Carlsson  <andersca@apple.com>
    224
  • trunk/WebKit2/UIProcess/API/mac/WKView.mm

    r63843 r64155  
    5050@interface WKViewData : NSObject {
    5151@public
     52    OwnPtr<PageClientImpl> _pageClient;
    5253    RefPtr<WebPageProxy> _page;
    5354
     
    8586    _data = [[WKViewData alloc] init];
    8687
     88    _data->_pageClient.set(new PageClientImpl(self));
    8789    _data->_page = toWK(pageNamespaceRef)->createWebPage();
    88     _data->_page->setPageClient(new PageClientImpl(self));
     90    _data->_page->setPageClient(_data->_pageClient.get());
    8991    _data->_page->initializeWebPage(IntSize(frame.size), new ChunkedUpdateDrawingAreaProxy(self));
    9092    _data->_page->setIsInWindow([self window]);
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r64132 r64155  
    9898void WebPageProxy::setPageClient(PageClient* pageClient)
    9999{
    100 #if PLATFORM(WIN)
    101100    m_pageClient = pageClient;
    102 #else
    103     m_pageClient.set(pageClient);
    104 #endif
    105101}
    106102
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r64065 r64155  
    211211#endif   
    212212
    213 #if PLATFORM(WIN)
    214213    PageClient* m_pageClient;
    215 #else
    216     // FIXME: This should not be an OwnPtr to the PageClient.  We need to find a better way to clean up m_pageClient on mac.
    217     // http://bugs.webkit.org/show_bug.cgi?id=40185
    218     OwnPtr<PageClient> m_pageClient;
    219 #endif
    220214    WebLoaderClient m_loaderClient;
    221215    WebPolicyClient m_policyClient;
Note: See TracChangeset for help on using the changeset viewer.