diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-04-10 16:02:52 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-04-12 09:35:38 +0000 |
commit | 1b7c7d853978d5a2ebc4ed06f4879c35bd68aa4f (patch) | |
tree | 31d5e633028fe2e35bf380519da78e7dba71c802 | |
parent | 89e5a7b1d874dda5b118017bfc6f16eee6a8493b (diff) |
Take BrowsingDataRemoverDelegateQt instance ownership by ProfileQt
Delegate assumed to be owned and released by BrowserContext instance
Change-Id: I1b5dc3ad2ace6f5c40b9f56e7ed7eb6b23b60925
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r-- | src/core/profile_qt.cpp | 4 | ||||
-rw-r--r-- | src/core/profile_qt.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index df05d891e..2387eba1b 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -194,7 +194,9 @@ content::BackgroundSyncController* ProfileQt::GetBackgroundSyncController() content::BrowsingDataRemoverDelegate *ProfileQt::GetBrowsingDataRemoverDelegate() { - return new BrowsingDataRemoverDelegateQt(); + if (!m_removerDelegate) + m_removerDelegate.reset(new BrowsingDataRemoverDelegateQt); + return m_removerDelegate.get(); } content::PermissionControllerDelegate *ProfileQt::GetPermissionControllerDelegate() diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h index 00119c053..b25ea047b 100644 --- a/src/core/profile_qt.h +++ b/src/core/profile_qt.h @@ -55,6 +55,7 @@ class PrefService; namespace QtWebEngineCore { +class BrowsingDataRemoverDelegateQt; class ProfileAdapter; class PermissionManagerQt; class SSLHostStateDelegateQt; @@ -113,6 +114,7 @@ private: friend class ContentBrowserClientQt; friend class WebContentsAdapter; scoped_refptr<net::URLRequestContextGetter> m_urlRequestContextGetter; + std::unique_ptr<BrowsingDataRemoverDelegateQt> m_removerDelegate; std::unique_ptr<PermissionManagerQt> m_permissionManager; std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate; std::unique_ptr<PrefService> m_prefService; |