[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:43:49 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit b45187980f751c5b3b65153288fb5c1dc772e135
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 13 14:27:11 2009 +0000

    2009-10-13  Girish Ramakrishnan  <girish at forwardbias.in>
    
            Reviewed by Simon Hausmann.
    
            [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead.
    
            This is a bug for two reasons:
            1. Everytime we use winId(), we end up creating a native widget. This causes an
            unnecessary copy of contents from the backing store to the native widget.
            2. Neither windowed nor windowless plugins require the winId of the QWebView or
            QGraphicsView.
    
            Introduce ownerWidget() which returns a QWidget * without creating a native widget
            (as opposed to QWidget::find(winId)).
    
           https://bugs.webkit.org/show_bug.cgi?id=30170
    
            * platform/qt/PlatformScreenQt.cpp:
            (WebCore::screenDepthPerComponent):
            * platform/qt/PopupMenuQt.cpp:
            (WebCore::PopupMenu::show):
            * platform/qt/QWebPageClient.h:
            * plugins/qt/PluginViewQt.cpp:
            (WebCore::setSharedXEventFields):
            (WebCore::PluginView::initXEvent):
            (WebCore::PluginView::getValue):
            (WebCore::PluginView::platformStart):
    2009-10-13  Girish Ramakrishnan  <girish at forwardbias.in>
    
            Reviewed by Simon Hausmann.
    
            [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead.
    
            This is a bug for two reasons:
            1. Everytime we use winId(), we end up creating a native widget. This causes an
            unnecessary copy of contents from the backing store to the native widget.
            2. Neither windowed nor windowless plugins require the winId of the QWebView or
            QGraphicsView.
    
            Introduce ownerWidget() which returns a QWidget * without creating a native widget
            (as opposed to QWidget::find(winId)).
    
            https://bugs.webkit.org/show_bug.cgi?id=30170
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebViewPrivate::ownerWidget):
            * Api/qwebview.cpp:
            (QWebViewPrivate::ownerWidget):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49502 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6f9706d..3ed4f17 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2009-10-13  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead.
+        
+        This is a bug for two reasons:
+        1. Everytime we use winId(), we end up creating a native widget. This causes an
+        unnecessary copy of contents from the backing store to the native widget.
+        2. Neither windowed nor windowless plugins require the winId of the QWebView or
+        QGraphicsView.
+        
+        Introduce ownerWidget() which returns a QWidget * without creating a native widget
+        (as opposed to QWidget::find(winId)).
+
+       https://bugs.webkit.org/show_bug.cgi?id=30170
+
+        * platform/qt/PlatformScreenQt.cpp:
+        (WebCore::screenDepthPerComponent):
+        * platform/qt/PopupMenuQt.cpp:
+        (WebCore::PopupMenu::show):
+        * platform/qt/QWebPageClient.h:
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::setSharedXEventFields):
+        (WebCore::PluginView::initXEvent):
+        (WebCore::PluginView::getValue):
+        (WebCore::PluginView::platformStart):
+
 2009-10-13  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
         Unreviewed build system fix. Typo in a filename.
diff --git a/WebCore/platform/qt/PlatformScreenQt.cpp b/WebCore/platform/qt/PlatformScreenQt.cpp
index 7ba8350..8221760 100644
--- a/WebCore/platform/qt/PlatformScreenQt.cpp
+++ b/WebCore/platform/qt/PlatformScreenQt.cpp
@@ -62,7 +62,7 @@ int screenDepthPerComponent(Widget* w)
         QWebPageClient* client = w->root()->hostWindow()->platformPageClient();
 
         if (client) {
-            QWidget* view = QWidget::find(client->winId());
+            QWidget* view = client->ownerWidget();
             if (view)
                 return view->depth();
         }
diff --git a/WebCore/platform/qt/PopupMenuQt.cpp b/WebCore/platform/qt/PopupMenuQt.cpp
index b44f2ec..f6ec4f7 100644
--- a/WebCore/platform/qt/PopupMenuQt.cpp
+++ b/WebCore/platform/qt/PopupMenuQt.cpp
@@ -92,7 +92,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
     rect.moveTopLeft(v->contentsToWindow(r.topLeft()));
     rect.setHeight(m_popup->sizeHint().height());
 
-    m_popup->setParent(QWidget::find(client->winId()));
+    m_popup->setParent(client->ownerWidget());
     m_popup->setGeometry(rect);
     m_popup->setCurrentIndex(index);
     m_popup->exec();
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index 2a285c5..28ef724 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -57,7 +57,7 @@ public:
 
     virtual QPalette palette() const = 0;
     virtual int screenNumber() const = 0;
-    virtual WId winId() const = 0;
+    virtual QWidget* ownerWidget() const = 0;
 
     virtual QObject* pluginParent() const = 0;
 
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index a5cbb9a..5d15b66 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -249,15 +249,15 @@ bool PluginView::dispatchNPEvent(NPEvent& event)
     return accepted;
 }
 
-void setSharedXEventFields(XEvent* xEvent, QWidget* hostWindow)
+void setSharedXEventFields(XEvent* xEvent, QWidget* ownerWidget)
 {
     xEvent->xany.serial = 0; // we are unaware of the last request processed by X Server
     xEvent->xany.send_event = false;
-    xEvent->xany.display = hostWindow->x11Info().display();
+    xEvent->xany.display = QX11Info::display();
     // NOTE: event->xany.window doesn't always respond to the .window property of other XEvent's
     // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
     // events; thus, this is right:
-    xEvent->xany.window = hostWindow->window()->handle();
+    xEvent->xany.window = ownerWidget ? ownerWidget->window()->handle() : 0;
 }
 
 void PluginView::initXEvent(XEvent* xEvent)
@@ -265,8 +265,8 @@ void PluginView::initXEvent(XEvent* xEvent)
     memset(xEvent, 0, sizeof(XEvent));
 
     QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
-    QWidget* window = QWidget::find(client->winId());
-    setSharedXEventFields(xEvent, window);
+    QWidget* ownerWidget = client ? client->ownerWidget() : 0;
+    setSharedXEventFields(xEvent, ownerWidget);
 }
 
 void setXKeyEventSpecificFields(XEvent* xEvent, KeyboardEvent* event)
@@ -577,13 +577,7 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
 
     switch (variable) {
     case NPNVxDisplay:
-        if (platformPluginWidget())
-            *(void **)value = platformPluginWidget()->x11Info().display();
-        else {
-            QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
-            QWidget* window = QWidget::find(client->winId());
-            *(void **)value = window->x11Info().display();
-        }
+        *(void **)value = QX11Info::display();
         return NPERR_NO_ERROR;
 
     case NPNVxtAppContext:
@@ -628,7 +622,8 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
 
     case NPNVnetscapeWindow: {
         void* w = reinterpret_cast<void*>(value);
-        *((XID *)w) = m_parentFrame->view()->hostWindow()->platformPageClient()->winId();
+        QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+        *((XID *)w) = client ? client->ownerWidget()->winId() : 0;
         return NPERR_NO_ERROR;
     }
 
@@ -756,7 +751,7 @@ bool PluginView::platformStart()
     if (m_isWindowed) {
         if (m_needsXEmbed) {
             QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
-            setPlatformWidget(new PluginContainerQt(this, QWidget::find(client->winId())));
+            setPlatformWidget(new PluginContainerQt(this, client->ownerWidget()));
             // sync our XEmbed container window creation before sending the xid to plugins.
             QApplication::syncX();
         } else {
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index aa38dcd..1e49d3e 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2009 Girish Ramakrishnan <girish at forwardbias.in>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -56,7 +57,7 @@ public:
 
     virtual QPalette palette() const;
     virtual int screenNumber() const;
-    virtual WId winId() const;
+    virtual QWidget* ownerWidget() const;
 
     virtual QObject* pluginParent() const;
 
@@ -144,14 +145,10 @@ int QGraphicsWebViewPrivate::screenNumber() const
     return 0;
 }
 
-WId QGraphicsWebViewPrivate::winId() const
+QWidget* QGraphicsWebViewPrivate::ownerWidget() const
 {
     const QList<QGraphicsView*> views = q->scene()->views();
-
-    if (!views.isEmpty())
-        return views.at(0)->winId();
-
-    return 0;
+    return views.value(0);
 }
 
 QObject* QGraphicsWebViewPrivate::pluginParent() const
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index b431c00..b900462 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2008 Holger Hans Peter Freyther
+    Copyright (C) 2009 Girish Ramakrishnan <girish at forwardbias.in>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -59,7 +60,7 @@ public:
 
     virtual QPalette palette() const;
     virtual int screenNumber() const;
-    virtual WId winId() const;
+    virtual QWidget* ownerWidget() const;
 
     virtual QObject* pluginParent() const;
 
@@ -121,12 +122,9 @@ int QWebViewPrivate::screenNumber() const
     return 0;
 }
 
-WId QWebViewPrivate::winId() const
+QWidget* QWebViewPrivate::ownerWidget() const
 {
-    if (view)
-        return view->winId();
-
-    return 0;
+    return view;
 }
 
 QObject* QWebViewPrivate::pluginParent() const
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f4f3e04..44821b4 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-13  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead.
+        
+        This is a bug for two reasons:
+        1. Everytime we use winId(), we end up creating a native widget. This causes an
+        unnecessary copy of contents from the backing store to the native widget.
+        2. Neither windowed nor windowless plugins require the winId of the QWebView or
+        QGraphicsView.
+        
+        Introduce ownerWidget() which returns a QWidget * without creating a native widget
+        (as opposed to QWidget::find(winId)).
+
+        https://bugs.webkit.org/show_bug.cgi?id=30170
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::ownerWidget):
+        * Api/qwebview.cpp:
+        (QWebViewPrivate::ownerWidget):
+
 2009-10-13  Antonio Gomes  <tonikitoo at webkit.org>
 
         Reviewed by Simon Hausmann.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list