Changeset 77253 in webkit


Ignore:
Timestamp:
Feb 1, 2011 9:09:26 AM (13 years ago)
Author:
kbalazs@webkit.org
Message:

2011-02-01 Balazs Kelemen <kbalazs@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.
Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r77250 r77253  
     12011-02-01  Balazs Kelemen  <kbalazs@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt][WK2] Add a way to use shared process model in MiniBrowser
     6        https://bugs.webkit.org/show_bug.cgi?id=53090
     7
     8        * MiniBrowser/qt/BrowserView.cpp:
     9        (BrowserView::BrowserView): Removed the m_context member.
     10        From now the context is guaranteed to be non-null and we
     11        don't need to store that in the object.
     12        * MiniBrowser/qt/BrowserView.h:
     13        * MiniBrowser/qt/BrowserWindow.cpp:
     14        Added static bool to determine that new windows need to be
     15        created with their own context or not. Use the same context
     16        and web process by default to be inilne with the other ports.
     17        (BrowserWindow::BrowserWindow):
     18        (BrowserWindow::newWindow):
     19        * MiniBrowser/qt/BrowserWindow.h:
     20        * MiniBrowser/qt/main.cpp:
     21        (main): Added command line switch to be able to use the
     22        non-shared process model. Simplify the handling of the command line
     23        switches a little bit.
     24
    1252011-02-01  Zoltan Horvath  <zoltan@webkit.org>
    226
  • trunk/Tools/MiniBrowser/qt/BrowserView.cpp

    r75373 r77253  
    3434    : QGraphicsView(parent)
    3535    , m_item(0)
    36     , m_context(context ? context : new QWKContext(this))
    3736{
    38     m_item = new QGraphicsWKView(m_context, backingStoreType, 0);
     37    m_item = new QGraphicsWKView(context, backingStoreType, 0);
    3938    setScene(new QGraphicsScene(this));
    4039    scene()->addItem(m_item);
  • trunk/Tools/MiniBrowser/qt/BrowserView.h

    r75373 r77253  
    4949private:
    5050    QGraphicsWKView* m_item;
    51     QWKContext* m_context;
    5251};
    5352
  • trunk/Tools/MiniBrowser/qt/BrowserWindow.cpp

    r77250 r77253  
    3838
    3939QGraphicsWKView::BackingStoreType BrowserWindow::backingStoreTypeForNewWindow = QGraphicsWKView::Simple;
     40bool BrowserWindow::useSeparateWebProcessPerWindow = false;
    4041
    4142QVector<qreal> BrowserWindow::m_zoomLevels;
     
    4445    : m_isZoomTextOnly(false)
    4546    , m_currentZoom(1)
     47    , m_context(context)
    4648    , m_browser(new BrowserView(backingStoreTypeForNewWindow, context))
    4749{
     
    142144BrowserWindow* BrowserWindow::newWindow(const QString& url)
    143145{
    144     BrowserWindow* window = new BrowserWindow;
     146    BrowserWindow* window;
     147    if (useSeparateWebProcessPerWindow) {
     148        QWKContext* context = new QWKContext();
     149        window = new BrowserWindow(context);
     150        context->setParent(window);
     151    } else
     152        window = new BrowserWindow(m_context);
     153
    145154    window->load(url);
    146155    return window;
  • trunk/Tools/MiniBrowser/qt/BrowserWindow.h

    r77250 r77253  
    3939
    4040public:
    41     BrowserWindow(QWKContext* = 0);
     41    BrowserWindow(QWKContext*);
    4242    ~BrowserWindow();
    4343    void load(const QString& url);
     
    4646
    4747    static QGraphicsWKView::BackingStoreType backingStoreTypeForNewWindow;
     48    static bool useSeparateWebProcessPerWindow;
    4849
    4950public slots:
     
    8485    qreal m_currentZoom;
    8586
     87    QWKContext* m_context;
    8688    BrowserView* m_browser;
    8789    QLineEdit* m_addressBar;
  • trunk/Tools/MiniBrowser/qt/main.cpp

    r75124 r77253  
    3939    args.removeAt(0);
    4040
    41     QGraphicsWKView::BackingStoreType backingStoreTypeToUse = QGraphicsWKView::Simple;
    4241    int indexOfTiledOption;
    43     if ((indexOfTiledOption = args.indexOf(QRegExp(QLatin1String("-tiled")))) != -1) {
    44         backingStoreTypeToUse = QGraphicsWKView::Tiled;
     42    if ((indexOfTiledOption = args.indexOf(QString::fromLatin1("-tiled"))) != -1) {
     43        BrowserWindow::backingStoreTypeForNewWindow = QGraphicsWKView::Tiled;
    4544        args.removeAt(indexOfTiledOption);
     45    }
     46
     47    int indexOfSeparateWebProcessOption;
     48    if ((indexOfSeparateWebProcessOption = args.indexOf(QString::fromLatin1("-separate-web-process-per-window"))) != -1) {
     49        BrowserWindow::useSeparateWebProcessPerWindow = true;
     50        args.removeAt(indexOfSeparateWebProcessOption);
    4651    }
    4752
     
    5459    }
    5560
    56     BrowserWindow::backingStoreTypeForNewWindow = backingStoreTypeToUse;
    57     BrowserWindow* window = new BrowserWindow;
     61    QWKContext* context = new QWKContext;
     62    BrowserWindow* window = new BrowserWindow(context);
     63    if (BrowserWindow::useSeparateWebProcessPerWindow)
     64        context->setParent(window);
     65
    5866    window->load(args[0]);
    5967
Note: See TracChangeset for help on using the changeset viewer.