summaryrefslogtreecommitdiff
path: root/src/core/profile_adapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/profile_adapter.cpp')
-rw-r--r--src/core/profile_adapter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 57bf3e752..54afc185d 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -82,6 +82,7 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
, m_persistentCookiesPolicy(AllowPersistentCookies)
, m_visitedLinksPolicy(TrackVisitedLinksOnDisk)
, m_httpCacheMaxSize(0)
+ , m_pageRequestInterceptors(0)
{
WebEngineContext::current()->addBrowserContext(this);
// creation of profile requires webengine context
@@ -98,6 +99,7 @@ ProfileAdapter::~ProfileAdapter()
m_profile->GetDownloadManager(m_profile.data())->Shutdown();
m_downloadManagerDelegate.reset();
}
+ Q_ASSERT(m_pageRequestInterceptors == 0);
}
void ProfileAdapter::setStorageName(const QString &storageName)
@@ -174,6 +176,22 @@ void ProfileAdapter::removeClient(ProfileAdapterClient *adapterClient)
m_clients.removeOne(adapterClient);
}
+void ProfileAdapter::addPageRequestInterceptor()
+{
+ ++m_pageRequestInterceptors;
+ if (m_profile->m_urlRequestContextGetter.get())
+ m_profile->m_profileIOData->updateRequestInterceptor();
+}
+
+void ProfileAdapter::removePageRequestInterceptor()
+{
+ Q_ASSERT(m_pageRequestInterceptors > 0);
+ --m_pageRequestInterceptors;
+ if (m_profile->m_urlRequestContextGetter.get())
+ m_profile->m_profileIOData->updateRequestInterceptor();
+}
+
+
void ProfileAdapter::cancelDownload(quint32 downloadId)
{
downloadManagerDelegate()->cancelDownload(downloadId);