Bug 40185 - WebPageProxy should keep a weak reference to the PageClient
Summary: WebPageProxy should keep a weak reference to the PageClient
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Adam Roben (:aroben)
Depends on:
Reported: 2010-06-04 13:21 PDT by Ada Chan
Modified: 2010-07-27 14:08 PDT (History)
5 users (show)

See Also:

Patch (3.42 KB, patch)
2010-07-27 14:01 PDT, Adam Roben (:aroben)
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ada Chan 2010-06-04 13:21:09 PDT
Right now WebPageProxy stores an OwnPtr to the PageClient.  That is not appropriate because WebPageProxy does not create the PageClient and it can be set to something that it should not own.  For example, on Windows, it's currently being set to the WebView itself.  This will cause a crash because WebView has a reference to WebPageProxy which has an OwnPtr to its PageClient, which is the WebView.
Comment 1 Adam Roben (:aroben) 2010-07-27 13:33:30 PDT
Seems like WKView should own the PageClient instead.
Comment 2 Adam Roben (:aroben) 2010-07-27 14:01:46 PDT
Created attachment 62743 [details]
Comment 3 Adam Roben (:aroben) 2010-07-27 14:08:58 PDT
Committed r64155: <http://trac.webkit.org/changeset/64155>