From a984c64b0a17d62ca5cd866ad64bd0679a0cca96 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 26 Jan 2015 15:39:10 +0100 Subject: Clean up global profiles and ownership MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andras Becsi --- src/core/web_engine_context.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/core/web_engine_context.h') 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 { public: static scoped_refptr current(); QtWebEngineCore::BrowserContextAdapter *defaultBrowserContext(); - QtWebEngineCore::BrowserContextAdapter *offTheRecordBrowserContext(); + QObject *globalQObject(); private: friend class base::RefCounted; @@ -77,8 +82,8 @@ private: #if defined(OS_ANDROID) scoped_ptr m_surfaceFactory; #endif + QObject* m_globalQObject; QExplicitlySharedDataPointer m_defaultBrowserContext; - QExplicitlySharedDataPointer m_offTheRecordBrowserContext; scoped_ptr m_devtools; }; -- cgit v1.2.3