diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-04 11:43:54 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-04 11:45:58 +0100 |
commit | 2b3f5b66af4f06a57216575a44f54c1d20fb12a0 (patch) | |
tree | b58f6a31b9d97b4693d485ea1a794fa6b8c5d875 /src/core/profile_adapter.cpp | |
parent | 4dc312011bcaa2ee2cf812b5b84dc9238130e608 (diff) | |
parent | 56fadb571f32b721d8b99554e6e38692009ec37f (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I1dd136df7004b11e2f38a2ec4e82a6fa81627479
Diffstat (limited to 'src/core/profile_adapter.cpp')
-rw-r--r-- | src/core/profile_adapter.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index 4625d238e..7070292d6 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -55,6 +55,7 @@ #include "type_conversion.h" #include "visited_links_manager_qt.h" #include "web_engine_context.h" +#include "web_contents_adapter_client.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -105,6 +106,9 @@ ProfileAdapter::ProfileAdapter(const QString &storageName): ProfileAdapter::~ProfileAdapter() { + while (!m_webContentsAdapterClients.isEmpty()) { + m_webContentsAdapterClients.first()->releaseProfile(); + } WebEngineContext::current()->removeProfileAdapter(this); if (m_downloadManagerDelegate) { m_profile->GetDownloadManager(m_profile.data())->Shutdown(); @@ -231,7 +235,8 @@ ProfileAdapter *ProfileAdapter::createDefaultProfileAdapter() ProfileAdapter *ProfileAdapter::defaultProfileAdapter() { - return WebEngineContext::current()->defaultProfileAdapter(); + WebEngineContext *context = WebEngineContext::current(); + return context ? context->defaultProfileAdapter() : nullptr; } QObject* ProfileAdapter::globalQObjectRoot() @@ -618,6 +623,16 @@ bool ProfileAdapter::isSpellCheckEnabled() const #endif } +void ProfileAdapter::addWebContentsAdapterClient(WebContentsAdapterClient *client) +{ + m_webContentsAdapterClients.append(client); +} + +void ProfileAdapter::removeWebContentsAdapterClient(WebContentsAdapterClient *client) +{ + m_webContentsAdapterClients.removeAll(client); +} + void ProfileAdapter::resetVisitedLinksManager() { m_visitedLinksManager.reset(new VisitedLinksManagerQt(m_profile.data(), persistVisitedLinks())); |