summaryrefslogtreecommitdiffstats
path: root/src/core/browser_context_adapter.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-01-26 15:39:10 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-03-12 13:27:21 +0000
commita984c64b0a17d62ca5cd866ad64bd0679a0cca96 (patch)
tree203e2470c5b651bf33f9d28f5b42854b3a1480a3 /src/core/browser_context_adapter.cpp
parent2cf54e48922a7d379fb7e212966d05bc402e475d (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.cpp')
-rw-r--r--src/core/browser_context_adapter.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp
index cb606a8b5..fa51575e3 100644
--- a/src/core/browser_context_adapter.cpp
+++ b/src/core/browser_context_adapter.cpp
@@ -72,7 +72,6 @@ BrowserContextAdapter::BrowserContextAdapter(bool offTheRecord)
, m_httpCacheType(DiskHttpCache)
, m_persistentCookiesPolicy(AllowPersistentCookies)
, m_visitedLinksPolicy(TrackVisitedLinksOnDisk)
- , m_client(0)
, m_httpCacheMaxSize(0)
{
}
@@ -133,9 +132,14 @@ DownloadManagerDelegateQt *BrowserContextAdapter::downloadManagerDelegate()
return m_downloadManagerDelegate.data();
}
-void BrowserContextAdapter::setClient(BrowserContextAdapterClient *adapterClient)
+void BrowserContextAdapter::addClient(BrowserContextAdapterClient *adapterClient)
{
- m_client = adapterClient;
+ m_clients.append(adapterClient);
+}
+
+void BrowserContextAdapter::removeClient(BrowserContextAdapterClient *adapterClient)
+{
+ m_clients.removeOne(adapterClient);
}
void BrowserContextAdapter::cancelDownload(quint32 downloadId)
@@ -148,9 +152,9 @@ BrowserContextAdapter* BrowserContextAdapter::defaultContext()
return WebEngineContext::current()->defaultBrowserContext();
}
-BrowserContextAdapter* BrowserContextAdapter::offTheRecordContext()
+QObject* BrowserContextAdapter::globalQObjectRoot()
{
- return WebEngineContext::current()->offTheRecordBrowserContext();
+ return WebEngineContext::current()->globalQObject();
}
QString BrowserContextAdapter::dataPath() const