[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

kbalazs at webkit.org kbalazs at webkit.org
Mon Feb 21 00:31:34 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 2104a7427bb287cf88f3e72b4122b00d35dd089a
Author: kbalazs at webkit.org <kbalazs at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 1 17:09:26 2011 +0000

    2011-02-01  Balazs Kelemen  <kbalazs at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt][WK2] Add a way to use shared process model in MiniBrowser
            https://bugs.webkit.org/show_bug.cgi?id=53090
    
            * MiniBrowser/qt/BrowserView.cpp:
            (BrowserView::BrowserView): Removed the m_context member.
            From now the context is guaranteed to be non-null and we
            don't need to store that in the object.
            * MiniBrowser/qt/BrowserView.h:
            * MiniBrowser/qt/BrowserWindow.cpp:
            Added static bool to determine that new windows need to be
            created with their own context or not. Use the same context
            and web process by default to be inilne with the other ports.
            (BrowserWindow::BrowserWindow):
            (BrowserWindow::newWindow):
            * MiniBrowser/qt/BrowserWindow.h:
            * MiniBrowser/qt/main.cpp:
            (main): Added command line switch to be able to use the
            non-shared process model. Simplify the handling of the command line
            switches a little bit.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 0081ebc..c11f611 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,27 @@
+2011-02-01  Balazs Kelemen  <kbalazs at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt][WK2] Add a way to use shared process model in MiniBrowser
+        https://bugs.webkit.org/show_bug.cgi?id=53090
+
+        * MiniBrowser/qt/BrowserView.cpp:
+        (BrowserView::BrowserView): Removed the m_context member.
+        From now the context is guaranteed to be non-null and we
+        don't need to store that in the object.
+        * MiniBrowser/qt/BrowserView.h:
+        * MiniBrowser/qt/BrowserWindow.cpp:
+        Added static bool to determine that new windows need to be
+        created with their own context or not. Use the same context
+        and web process by default to be inilne with the other ports.
+        (BrowserWindow::BrowserWindow):
+        (BrowserWindow::newWindow):
+        * MiniBrowser/qt/BrowserWindow.h:
+        * MiniBrowser/qt/main.cpp:
+        (main): Added command line switch to be able to use the
+        non-shared process model. Simplify the handling of the command line
+        switches a little bit.
+
 2011-02-01  Zoltan Horvath  <zoltan at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/Tools/MiniBrowser/qt/BrowserView.cpp b/Tools/MiniBrowser/qt/BrowserView.cpp
index 6118f79..18d262b 100644
--- a/Tools/MiniBrowser/qt/BrowserView.cpp
+++ b/Tools/MiniBrowser/qt/BrowserView.cpp
@@ -33,9 +33,8 @@
 BrowserView::BrowserView(QGraphicsWKView::BackingStoreType backingStoreType, QWKContext* context, QWidget* parent)
     : QGraphicsView(parent)
     , m_item(0)
-    , m_context(context ? context : new QWKContext(this))
 {
-    m_item = new QGraphicsWKView(m_context, backingStoreType, 0);
+    m_item = new QGraphicsWKView(context, backingStoreType, 0);
     setScene(new QGraphicsScene(this));
     scene()->addItem(m_item);
 
diff --git a/Tools/MiniBrowser/qt/BrowserView.h b/Tools/MiniBrowser/qt/BrowserView.h
index e19cc59..593006e 100644
--- a/Tools/MiniBrowser/qt/BrowserView.h
+++ b/Tools/MiniBrowser/qt/BrowserView.h
@@ -48,7 +48,6 @@ protected:
 
 private:
     QGraphicsWKView* m_item;
-    QWKContext* m_context;
 };
 
 #endif
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.cpp b/Tools/MiniBrowser/qt/BrowserWindow.cpp
index eecb88a..a235e5f 100644
--- a/Tools/MiniBrowser/qt/BrowserWindow.cpp
+++ b/Tools/MiniBrowser/qt/BrowserWindow.cpp
@@ -37,12 +37,14 @@ static QWKPage* newPageFunction(QWKPage* page)
 }
 
 QGraphicsWKView::BackingStoreType BrowserWindow::backingStoreTypeForNewWindow = QGraphicsWKView::Simple;
+bool BrowserWindow::useSeparateWebProcessPerWindow = false;
 
 QVector<qreal> BrowserWindow::m_zoomLevels;
 
 BrowserWindow::BrowserWindow(QWKContext* context)
     : m_isZoomTextOnly(false)
     , m_currentZoom(1)
+    , m_context(context)
     , m_browser(new BrowserView(backingStoreTypeForNewWindow, context))
 {
     setAttribute(Qt::WA_DeleteOnClose);
@@ -141,7 +143,14 @@ QWKPage* BrowserWindow::page()
 
 BrowserWindow* BrowserWindow::newWindow(const QString& url)
 {
-    BrowserWindow* window = new BrowserWindow;
+    BrowserWindow* window;
+    if (useSeparateWebProcessPerWindow) {
+        QWKContext* context = new QWKContext();
+        window = new BrowserWindow(context);
+        context->setParent(window);
+    } else
+        window = new BrowserWindow(m_context);
+
     window->load(url);
     return window;
 }
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h
index f48ac99..b43e1a4 100644
--- a/Tools/MiniBrowser/qt/BrowserWindow.h
+++ b/Tools/MiniBrowser/qt/BrowserWindow.h
@@ -38,13 +38,14 @@ class BrowserWindow : public QMainWindow {
     Q_OBJECT
 
 public:
-    BrowserWindow(QWKContext* = 0);
+    BrowserWindow(QWKContext*);
     ~BrowserWindow();
     void load(const QString& url);
 
     QWKPage* page();
 
     static QGraphicsWKView::BackingStoreType backingStoreTypeForNewWindow;
+    static bool useSeparateWebProcessPerWindow;
 
 public slots:
     BrowserWindow* newWindow(const QString& url = "about:blank");
@@ -83,6 +84,7 @@ private:
     bool m_isZoomTextOnly;
     qreal m_currentZoom;
 
+    QWKContext* m_context;
     BrowserView* m_browser;
     QLineEdit* m_addressBar;
     QStringList m_userAgentList;
diff --git a/Tools/MiniBrowser/qt/main.cpp b/Tools/MiniBrowser/qt/main.cpp
index 8c987c5..d66e82c 100644
--- a/Tools/MiniBrowser/qt/main.cpp
+++ b/Tools/MiniBrowser/qt/main.cpp
@@ -38,13 +38,18 @@ int main(int argc, char** argv) {
     QStringList args = QApplication::arguments();
     args.removeAt(0);
 
-    QGraphicsWKView::BackingStoreType backingStoreTypeToUse = QGraphicsWKView::Simple;
     int indexOfTiledOption;
-    if ((indexOfTiledOption = args.indexOf(QRegExp(QLatin1String("-tiled")))) != -1) {
-        backingStoreTypeToUse = QGraphicsWKView::Tiled;
+    if ((indexOfTiledOption = args.indexOf(QString::fromLatin1("-tiled"))) != -1) {
+        BrowserWindow::backingStoreTypeForNewWindow = QGraphicsWKView::Tiled;
         args.removeAt(indexOfTiledOption);
     }
 
+    int indexOfSeparateWebProcessOption;
+    if ((indexOfSeparateWebProcessOption = args.indexOf(QString::fromLatin1("-separate-web-process-per-window"))) != -1) {
+        BrowserWindow::useSeparateWebProcessPerWindow = true;
+        args.removeAt(indexOfSeparateWebProcessOption);
+    }
+
     if (args.isEmpty()) {
         QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
         if (QDir(defaultUrl).exists())
@@ -53,8 +58,11 @@ int main(int argc, char** argv) {
             args.append("http://www.google.com");
     }
 
-    BrowserWindow::backingStoreTypeForNewWindow = backingStoreTypeToUse;
-    BrowserWindow* window = new BrowserWindow;
+    QWKContext* context = new QWKContext;
+    BrowserWindow* window = new BrowserWindow(context);
+    if (BrowserWindow::useSeparateWebProcessPerWindow)
+        context->setParent(window);
+
     window->load(args[0]);
 
     for (int i = 1; i < args.size(); ++i)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list