[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 13:45:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8c06fce0a0b4080531a6d06b4b64bedb9fdf2b2b
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 22:12:00 2010 +0000

    Pass the WebView's HWND over to the web process
    
    The HWND is packaged up in the WebPageCreationParameters and stored in
    the WebPage. It will eventually be used by windowed plugins.
    
    Fixes <http://webkit.org/b/46512> WebPage needs access to its
    corresponding HWND from the UI process
    
    Reviewed by Anders Carlsson.
    
    * Shared/WebPageCreationParameters.cpp:
    (WebKit::WebPageCreationParameters::encode):
    (WebKit::WebPageCreationParameters::decode):
    Encode and decode the HWND as a uint64_t.
    
    * Shared/WebPageCreationParameters.h: Added a nativeWindow member to
    store the HWND.
    
    * UIProcess/PageClient.h: Added a nativeWindow function on Windows.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::creationParameters): Store the HWND from the
    page client in the struct to be sent to the web process.
    
    * UIProcess/win/WebView.cpp:
    (WebKit::WebView::WebView): Moved the call to initializeWebPage after
    we've created our window so that our window will be ready when
    WebPageProxy asks for it to send it to the web process.
    (WebKit::WebView::nativeWindow): Added. Just returns our window.
    
    * UIProcess/win/WebView.h: Added nativeWindow.
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::WebPage): Store the HWND in the new m_nativeWindow
    member.
    
    * WebProcess/WebPage/WebPage.h:
    (WebKit::WebPage::nativeWindow): Added this simple getter.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 12a1313..a30ba3a 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,46 @@
 2010-09-24  Adam Roben  <aroben at apple.com>
 
+        Pass the WebView's HWND over to the web process
+
+        The HWND is packaged up in the WebPageCreationParameters and stored in
+        the WebPage. It will eventually be used by windowed plugins.
+
+        Fixes <http://webkit.org/b/46512> WebPage needs access to its
+        corresponding HWND from the UI process
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        Encode and decode the HWND as a uint64_t.
+
+        * Shared/WebPageCreationParameters.h: Added a nativeWindow member to
+        store the HWND.
+
+        * UIProcess/PageClient.h: Added a nativeWindow function on Windows.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::creationParameters): Store the HWND from the
+        page client in the struct to be sent to the web process.
+
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::WebView): Moved the call to initializeWebPage after
+        we've created our window so that our window will be ready when
+        WebPageProxy asks for it to send it to the web process.
+        (WebKit::WebView::nativeWindow): Added. Just returns our window.
+
+        * UIProcess/win/WebView.h: Added nativeWindow.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage): Store the HWND in the new m_nativeWindow
+        member.
+
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::nativeWindow): Added this simple getter.
+
+2010-09-24  Adam Roben  <aroben at apple.com>
+
         Add WebPageProxy::creationParameters
 
         Fixes <http://webkit.org/b/46510> WebPageProxy has a bunch of
diff --git a/WebKit2/Shared/WebPageCreationParameters.cpp b/WebKit2/Shared/WebPageCreationParameters.cpp
index b8b09c3..ea731d4 100644
--- a/WebKit2/Shared/WebPageCreationParameters.cpp
+++ b/WebKit2/Shared/WebPageCreationParameters.cpp
@@ -34,6 +34,10 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const
     encoder->encode(viewSize);
     encoder->encode(store);
     encoder->encode(drawingAreaInfo);
+
+#if PLATFORM(WIN)
+    encoder->encode(reinterpret_cast<uint64_t>(nativeWindow));
+#endif
 }
 
 bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPageCreationParameters& parameters)
@@ -44,6 +48,14 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPag
         return false;
     if (!decoder->decode(parameters.drawingAreaInfo))
         return false;
+
+#if PLATFORM(WIN)
+    uint64_t nativeWindow;
+    if (!decoder->decode(nativeWindow))
+        return false;
+    parameters.nativeWindow = reinterpret_cast<HWND>(nativeWindow);
+#endif
+
     return true;
 }
 
diff --git a/WebKit2/Shared/WebPageCreationParameters.h b/WebKit2/Shared/WebPageCreationParameters.h
index 9cb9e5d..4f6a98f 100644
--- a/WebKit2/Shared/WebPageCreationParameters.h
+++ b/WebKit2/Shared/WebPageCreationParameters.h
@@ -44,6 +44,9 @@ struct WebPageCreationParameters {
     WebCore::IntSize viewSize;
     WebPreferencesStore store;
     DrawingAreaBase::DrawingAreaInfo drawingAreaInfo;
+#if PLATFORM(WIN)
+    HWND nativeWindow;
+#endif
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/PageClient.h b/WebKit2/UIProcess/PageClient.h
index 57e0fa4..77b4113 100644
--- a/WebKit2/UIProcess/PageClient.h
+++ b/WebKit2/UIProcess/PageClient.h
@@ -56,6 +56,10 @@ public:
     virtual void pageDidEnterAcceleratedCompositing() = 0;
     virtual void pageDidLeaveAcceleratedCompositing() = 0;
 #endif
+
+#if PLATFORM(WIN)
+    virtual HWND nativeWindow() = 0;
+#endif
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 9ba516c..d0aca0f 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1350,6 +1350,11 @@ WebPageCreationParameters WebPageProxy::creationParameters(const IntSize& size)
     parameters.viewSize = size;
     parameters.store = pageNamespace()->context()->preferences()->store();
     parameters.drawingAreaInfo = m_drawingArea->info();
+
+#if PLATFORM(WIN)
+    parameters.nativeWindow = m_pageClient->nativeWindow();
+#endif
+
     return parameters;
 }
 
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index eefe28f..669e1df 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -186,12 +186,13 @@ WebView::WebView(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow)
     m_page = pageNamespace->createWebPage();
     m_page->setPageClient(this);
     m_page->setDrawingArea(ChunkedUpdateDrawingAreaProxy::create(this));
-    m_page->initializeWebPage(IntRect(rect).size());
 
     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);
     ASSERT(::IsWindow(m_window));
 
+    m_page->initializeWebPage(IntRect(rect).size());
+
     ::ShowWindow(m_window, SW_SHOW);
 
     // FIXME: Initializing the tooltip window here matches WebKit win, but seems like something
@@ -589,6 +590,11 @@ void WebView::pageDidLeaveAcceleratedCompositing()
 }
 #endif // USE(ACCELERATED_COMPOSITING)
 
+HWND WebView::nativeWindow()
+{
+    return m_window;
+}
+
 // WebCore::WindowMessageListener
 
 void WebView::windowReceivedMessage(HWND, UINT message, WPARAM wParam, LPARAM)
diff --git a/WebKit2/UIProcess/win/WebView.h b/WebKit2/UIProcess/win/WebView.h
index 6815c91..e6e40a3 100644
--- a/WebKit2/UIProcess/win/WebView.h
+++ b/WebKit2/UIProcess/win/WebView.h
@@ -103,6 +103,8 @@ private:
     virtual void pageDidLeaveAcceleratedCompositing();
 #endif
 
+    virtual HWND nativeWindow();
+
     // WebCore::WindowMessageListener
     virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM);
 
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 9ae2f63..b602f37 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -98,6 +98,8 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     , m_isInRedo(false)
 #if PLATFORM(MAC)
     , m_windowIsVisible(false)
+#elif PLATFORM(WIN)
+    , m_nativeWindow(parameters.nativeWindow)
 #endif
     , m_pageID(pageID)
 {
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 3a25f4e..049e91c 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -152,6 +152,8 @@ public:
     bool windowIsVisible() const { return m_windowIsVisible; }
     const WebCore::IntRect& windowFrame() const { return m_windowFrame; }
     bool windowIsFocused() const;
+#elif PLATFORM(WIN)
+    HWND nativeWindow() const { return m_nativeWindow; }
 #endif
 
     static const WebEvent* currentEvent();
@@ -231,6 +233,9 @@ private:
 
     // All plug-in views on this web page.
     HashSet<PluginView*> m_pluginViews;
+#elif PLATFORM(WIN)
+    // Our view's window (in the UI process).
+    HWND m_nativeWindow;
 #endif
     
     HashMap<uint64_t, RefPtr<WebEditCommand> > m_editCommandMap;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list