[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 14:50:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 199eeaf412dbbfdd7b2da6070548f8f1e2cb3165
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 21 17:03:18 2010 +0000

    Remove confusing and redundant "host window" terminology from WKView on Windows
    
    WKView's "host window" is really just its HWND's parent window. The
    terminology has been updated to reflect this. The unnecessary
    WKViewGetHostWindow function has been removed, as it was a synonym for
    ::GetParent(WKViewGetWindow(view)).
    
    Fixes <http://webkit.org/b/48039> WKView's "host window" API is
    confusing
    
    Reviewed by Sam Weinig.
    
    * UIProcess/API/C/win/WKView.cpp:
    (WKViewCreate):
    (WKViewSetParentWindow):
    * UIProcess/API/C/win/WKView.h:
    Replaced "host window" with "parent window". Removed
    WKViewGetHostWindow.
    
    * UIProcess/win/WebView.cpp:
    (WebKit::WebView::WebView):
    (WebKit::WebView::setParentWindow):
    (WebKit::WebView::windowAncestryDidChange):
    (WebKit::WebView::close):
    * UIProcess/win/WebView.h:
    (WebKit::WebView::create):
    Replaced "host window" with "parent window". Removed m_hostWindow and
    hostWindow().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70245 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6c5c903..9e5c7f8 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,35 @@
+2010-10-20  Adam Roben  <aroben at apple.com>
+
+        Remove confusing and redundant "host window" terminology from WKView on
+        Windows
+
+        WKView's "host window" is really just its HWND's parent window. The
+        terminology has been updated to reflect this. The unnecessary
+        WKViewGetHostWindow function has been removed, as it was a synonym for
+        ::GetParent(WKViewGetWindow(view)).
+
+        Fixes <http://webkit.org/b/48039> WKView's "host window" API is
+        confusing
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/C/win/WKView.cpp:
+        (WKViewCreate):
+        (WKViewSetParentWindow):
+        * UIProcess/API/C/win/WKView.h:
+        Replaced "host window" with "parent window". Removed
+        WKViewGetHostWindow.
+
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::WebView):
+        (WebKit::WebView::setParentWindow):
+        (WebKit::WebView::windowAncestryDidChange):
+        (WebKit::WebView::close):
+        * UIProcess/win/WebView.h:
+        (WebKit::WebView::create):
+        Replaced "host window" with "parent window". Removed m_hostWindow and
+        hostWindow().
+
 2010-10-21  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/WebKit2/UIProcess/API/C/win/WKView.cpp b/WebKit2/UIProcess/API/C/win/WKView.cpp
index d1a9d99..e90a286 100644
--- a/WebKit2/UIProcess/API/C/win/WKView.cpp
+++ b/WebKit2/UIProcess/API/C/win/WKView.cpp
@@ -35,9 +35,9 @@ WKTypeID WKViewGetTypeID()
     return toAPI(APIObject::TypeView);
 }
 
-WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespaceRef, HWND hostWindow)
+WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespaceRef, HWND parentWindow)
 {
-    RefPtr<WebView> view = WebView::create(rect, toImpl(pageNamespaceRef), hostWindow);
+    RefPtr<WebView> view = WebView::create(rect, toImpl(pageNamespaceRef), parentWindow);
     return toAPI(view.release().releaseRef());
 }
 
@@ -46,19 +46,14 @@ HWND WKViewGetWindow(WKViewRef viewRef)
     return toImpl(viewRef)->window();
 }
 
-HWND WKViewGetHostWindow(WKViewRef viewRef)
-{
-    return toImpl(viewRef)->hostWindow();
-}
-
 WKPageRef WKViewGetPage(WKViewRef viewRef)
 {
     return toAPI(toImpl(viewRef)->page());
 }
 
-void WKViewSetHostWindow(WKViewRef viewRef, HWND hostWindow)
+void WKViewSetParentWindow(WKViewRef viewRef, HWND hostWindow)
 {
-    toImpl(viewRef)->setHostWindow(hostWindow);
+    toImpl(viewRef)->setParentWindow(hostWindow);
 }
 
 void WKViewWindowAncestryDidChange(WKViewRef viewRef)
diff --git a/WebKit2/UIProcess/API/C/win/WKView.h b/WebKit2/UIProcess/API/C/win/WKView.h
index b40a000..817cc4c 100644
--- a/WebKit2/UIProcess/API/C/win/WKView.h
+++ b/WebKit2/UIProcess/API/C/win/WKView.h
@@ -35,14 +35,13 @@ extern "C" {
 
 WK_EXPORT WKTypeID WKViewGetTypeID();
 
-WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespace, HWND hostWindow);
+WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespace, HWND parentWindow);
 
 WK_EXPORT HWND WKViewGetWindow(WKViewRef view);
-WK_EXPORT HWND WKViewGetHostWindow(WKViewRef view);
 
 WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);
 
-WK_EXPORT void WKViewSetHostWindow(WKViewRef view, HWND hostWindow);
+WK_EXPORT void WKViewSetParentWindow(WKViewRef view, HWND parentWindow);
 WK_EXPORT void WKViewWindowAncestryDidChange(WKViewRef view);
 
 #ifdef __cplusplus
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index 52e8be8..dfbc847 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -176,9 +176,8 @@ bool WebView::registerWebViewWindowClass()
     return !!::RegisterClassEx(&wcex);
 }
 
-WebView::WebView(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow)
+WebView::WebView(RECT rect, WebPageNamespace* pageNamespace, HWND parentWindow)
     : m_rect(rect)
-    , m_hostWindow(hostWindow)
     , m_topLevelParentWindow(0)
     , m_toolTipWindow(0)
     , m_lastCursorSet(0)
@@ -192,7 +191,7 @@ WebView::WebView(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow)
     m_page->setDrawingArea(ChunkedUpdateDrawingAreaProxy::create(this));
 
     m_window = ::CreateWindowEx(0, kWebKit2WebViewWindowClassName, 0, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
-        rect.top, rect.left, rect.right - rect.left, rect.bottom - rect.top, m_hostWindow ? m_hostWindow : HWND_MESSAGE, 0, instanceHandle(), this);
+        rect.top, rect.left, rect.right - rect.left, rect.bottom - rect.top, parentWindow ? parentWindow : HWND_MESSAGE, 0, instanceHandle(), this);
     ASSERT(::IsWindow(m_window));
 
     m_page->initializeWebPage(IntRect(rect).size());
@@ -214,25 +213,23 @@ WebView::~WebView()
         ::DestroyWindow(m_toolTipWindow);
 }
 
-void WebView::setHostWindow(HWND hostWindow)
+void WebView::setParentWindow(HWND parentWindow)
 {
     if (m_window) {
         // If the host window hasn't changed, bail.
-        if (GetParent(m_window) == hostWindow)
+        if (::GetParent(m_window) == parentWindow)
             return;
-        if (hostWindow)
-            SetParent(m_window, hostWindow);
+        if (parentWindow)
+            ::SetParent(m_window, parentWindow);
         else if (!m_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
+            // old parent 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_window in a weird state (see <http://webkit.org/b/29337>).
-            SetParent(m_window, HWND_MESSAGE);
+            ::SetParent(m_window, HWND_MESSAGE);
         }
     }
 
-    m_hostWindow = hostWindow;
-    
     windowAncestryDidChange();
 }
 
@@ -254,7 +251,7 @@ void WebView::windowAncestryDidChange()
 {
     HWND newTopLevelParentWindow;
     if (m_window)
-        newTopLevelParentWindow = findTopLevelParentWindow(m_hostWindow);
+        newTopLevelParentWindow = findTopLevelParentWindow(m_window);
     else {
         // There's no point in tracking active state changes of our parent window if we don't have
         // a window ourselves.
@@ -529,7 +526,7 @@ void WebView::stopTrackingMouseLeave()
 
 void WebView::close()
 {
-    setHostWindow(0);
+    setParentWindow(0);
     m_page->close();
 }
 
diff --git a/WebKit2/UIProcess/win/WebView.h b/WebKit2/UIProcess/win/WebView.h
index 2165e53..89ac830 100644
--- a/WebKit2/UIProcess/win/WebView.h
+++ b/WebKit2/UIProcess/win/WebView.h
@@ -41,23 +41,22 @@ class WebPageNamespace;
 
 class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener {
 public:
-    static PassRefPtr<WebView> create(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow)
+    static PassRefPtr<WebView> create(RECT rect, WebPageNamespace* pageNamespace, HWND parentWindow)
     {
-        return adoptRef(new WebView(rect, pageNamespace, hostWindow));
+        return adoptRef(new WebView(rect, pageNamespace, parentWindow));
     }
     ~WebView();
 
     RECT rect() const { return m_rect; }
 
     HWND window() const { return m_window; }
-    HWND hostWindow() const { return m_hostWindow; }
-    void setHostWindow(HWND);
+    void setParentWindow(HWND);
     void windowAncestryDidChange();
 
     WebPageProxy* page() const { return m_page.get(); }
 
 private:
-    WebView(RECT, WebPageNamespace*, HWND hostWindow);
+    WebView(RECT, WebPageNamespace*, HWND parentWindow);
 
     virtual Type type() const { return TypeView; }
 
@@ -117,7 +116,6 @@ private:
 
     RECT m_rect;
     HWND m_window;
-    HWND m_hostWindow;
     HWND m_topLevelParentWindow;
     HWND m_toolTipWindow;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list