[webkit-reviews] review granted: [Bug 40152] WebKit2: Need to remove WebView from WindowMessageBroadcaster's listeners list after the WebView is destroyed : [Attachment 57843] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 3 22:08:16 PDT 2010


Adam Roben (aroben) <aroben at apple.com> has granted  review:
Bug 40152: WebKit2: Need to remove WebView from WindowMessageBroadcaster's
listeners list after the WebView is destroyed
https://bugs.webkit.org/show_bug.cgi?id=40152

Attachment 57843: Patch
https://bugs.webkit.org/attachment.cgi?id=57843&action=review

------- Additional Comments from Adam Roben (aroben) <aroben at apple.com>
> +void WebView::setHostWindow(HWND hostWindow)
> +{
> +    if (m_window) {
> +	   if (hostWindow)
> +	       SetParent(m_window, hostWindow);
> +	   else if (!isBeingDestroyed()) {
> +	       // Turn the WebView into a message-only window so it will no
longer be a child of the
> +	       // old host window and will be hidden from screen. We only do
this when
> +	       // isBeingDestroyed() is false because doing this while handling
WM_DESTROY can leave
> +	       // m_viewWindow in a weird state (see
<http://webkit.org/b/29337>).
> +	       SetParent(m_window, HWND_MESSAGE);
> +	   }

The comment should be updated to say m_window, not m_viewWindow.

Let's just bail out early if GetParent(m_window) == hostWindow. (I know WebView
doesn't do that, but it seems like a good idea.)

I don't think the private set/isBeginDestroyed functions are all that helpful.

r=me


More information about the webkit-reviews mailing list