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/web_engine_context.cpp | |
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/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 5d8fe79e6..b830110a7 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -138,6 +138,9 @@ bool usingQtQuick2DRenderer() WebEngineContext::~WebEngineContext() { + m_defaultBrowserContext = 0; + delete m_globalQObject; + m_globalQObject = 0; base::MessagePump::Delegate *delegate = m_runLoop->loop_; // Flush the UI message loop before quitting. while (delegate->DoWork()) { } @@ -162,11 +165,9 @@ BrowserContextAdapter* WebEngineContext::defaultBrowserContext() return m_defaultBrowserContext.data(); } -BrowserContextAdapter* WebEngineContext::offTheRecordBrowserContext() +QObject *WebEngineContext::globalQObject() { - if (!m_offTheRecordBrowserContext) - m_offTheRecordBrowserContext = new BrowserContextAdapter(true); - return m_offTheRecordBrowserContext.data(); + return m_globalQObject; } #ifndef CHROMIUM_VERSION @@ -178,6 +179,7 @@ WebEngineContext::WebEngineContext() : m_mainDelegate(new ContentMainDelegateQt) , m_contentRunner(content::ContentMainRunner::Create()) , m_browserRunner(content::BrowserMainRunner::Create()) + , m_globalQObject(new QObject()) { QList<QByteArray> args; Q_FOREACH (const QString& arg, QCoreApplication::arguments()) |