summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.h
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/web_engine_context.h
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/web_engine_context.h')
-rw-r--r--src/core/web_engine_context.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index 5f45aad98..a3795b0a9 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -37,6 +37,8 @@
#ifndef WEB_ENGINE_CONTEXT_H
#define WEB_ENGINE_CONTEXT_H
+#include "qtwebenginecoreglobal.h"
+
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -51,19 +53,22 @@ class BrowserMainRunner;
class ContentMainRunner;
}
+QT_FORWARD_DECLARE_CLASS(QObject)
+
namespace QtWebEngineCore {
+
class BrowserContextAdapter;
class ContentMainDelegateQt;
class DevToolsHttpHandlerDelegateQt;
class SurfaceFactoryQt;
-}
+} // namespace
class WebEngineContext : public base::RefCounted<WebEngineContext> {
public:
static scoped_refptr<WebEngineContext> current();
QtWebEngineCore::BrowserContextAdapter *defaultBrowserContext();
- QtWebEngineCore::BrowserContextAdapter *offTheRecordBrowserContext();
+ QObject *globalQObject();
private:
friend class base::RefCounted<WebEngineContext>;
@@ -77,8 +82,8 @@ private:
#if defined(OS_ANDROID)
scoped_ptr<QtWebEngineCore::SurfaceFactoryQt> m_surfaceFactory;
#endif
+ QObject* m_globalQObject;
QExplicitlySharedDataPointer<QtWebEngineCore::BrowserContextAdapter> m_defaultBrowserContext;
- QExplicitlySharedDataPointer<QtWebEngineCore::BrowserContextAdapter> m_offTheRecordBrowserContext;
scoped_ptr<QtWebEngineCore::DevToolsHttpHandlerDelegateQt> m_devtools;
};