diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-01-26 15:39:10 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-12 13:27:21 +0000 |
commit | a984c64b0a17d62ca5cd866ad64bd0679a0cca96 (patch) | |
tree | 203e2470c5b651bf33f9d28f5b42854b3a1480a3 /src/core/browser_context_adapter.h | |
parent | 2cf54e48922a7d379fb7e212966d05bc402e475d (diff) |
Clean up global profiles and ownership
This patch removes the unused global off-the-record browser-contexts
and changes all browser-contexts to be ref-counted by an API level
profile.
The API default profiles are now owned by a global QObject and are
deleted on exit.
Change-Id: Id7c9eafa24829118105f58b66663a6348216823d
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/browser_context_adapter.h')
-rw-r--r-- | src/core/browser_context_adapter.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index 0e5a3605d..42787bc23 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -39,15 +39,17 @@ #include "qtwebenginecoreglobal.h" +#include <QList> #include <QScopedPointer> #include <QSharedData> #include <QString> #include <QVector> +QT_FORWARD_DECLARE_CLASS(QObject) + namespace QtWebEngineCore { class BrowserContextAdapterClient; - class BrowserContextQt; class CustomUrlSchemeHandler; class DownloadManagerDelegateQt; @@ -62,14 +64,15 @@ public: virtual ~BrowserContextAdapter(); static BrowserContextAdapter* defaultContext(); - static BrowserContextAdapter* offTheRecordContext(); + static QObject* globalQObjectRoot(); WebEngineVisitedLinksManager *visitedLinksManager(); DownloadManagerDelegateQt *downloadManagerDelegate(); - BrowserContextAdapterClient* client() { return m_client; } + QList<BrowserContextAdapterClient*> clients() { return m_clients; } + void addClient(BrowserContextAdapterClient *adapterClient); + void removeClient(BrowserContextAdapterClient *adapterClient); - void setClient(BrowserContextAdapterClient *adapterClient); void cancelDownload(quint32 downloadId); BrowserContextQt *browserContext(); @@ -144,7 +147,7 @@ private: PersistentCookiesPolicy m_persistentCookiesPolicy; VisitedLinksPolicy m_visitedLinksPolicy; QVector<CustomUrlSchemeHandler*> m_customUrlSchemeHandlers; - BrowserContextAdapterClient *m_client; + QList<BrowserContextAdapterClient*> m_clients; int m_httpCacheMaxSize; Q_DISABLE_COPY(BrowserContextAdapter) |