diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-07-26 09:37:11 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-08-17 20:26:43 +0200 |
commit | 37430020d373304f812fa822651cf2a0ccf636d3 (patch) | |
tree | a4c6b84fbb12a9c56d0ee9b91ce5192eb7514e56 /src/core/profile_io_data_qt.h | |
parent | b18818d918ed9f2d9775d1786ef641dfa30aadf6 (diff) |
Add clearHttpCacheCompleted signal to profile
[ChangeLog][QtWebEngineQuick][WebEngineProfile] Added
clearHttpCacheCompleted signal.
[ChangeLog][QtWebEngineCore][QWebEngineProfile] Added
clearHttpCacheCompleted signal.
Fixes: QTBUG-89670
Fixes: QTBUG-111541
Change-Id: If93a99f7171c516ef75a3c8004da9ae621705a1a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.h')
-rw-r--r-- | src/core/profile_io_data_qt.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index 430efedb4..a2430adec 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -5,6 +5,7 @@ #define PROFILE_IO_DATA_QT_H #include "content/public/browser/browsing_data_remover.h" +#include "content/public/browser/storage_partition.h" #include "chrome/browser/profiles/profile.h" #include "extensions/buildflags/buildflags.h" @@ -49,9 +50,15 @@ private: // we still use shared memebers and use mutex which breaks // idea for this object, but this is wip. -class ProfileIODataQt { +class ProfileIODataQt : public content::StoragePartition::NetworkContextCreatedObserver { public: + enum ClearHttpCacheState { + Completed = 0, + Removing, + Resetting + }; + ProfileIODataQt(ProfileQt *profile); // runs on ui thread virtual ~ProfileIODataQt(); @@ -68,8 +75,9 @@ public: void setFullConfiguration(); // runs on ui thread void resetNetworkContext(); // runs on ui thread + void clearHttpCache(); // runs on ui thread - bool isClearHttpCacheInProgress() { return m_clearHttpCacheInProgress; } + bool isClearHttpCacheInProgress() const { return m_clearHttpCacheState != Completed; } void ConfigureNetworkContextParams(bool in_memory, const base::FilePath &relative_partition_path, @@ -86,6 +94,9 @@ public: CookieMonsterDelegateQt *cookieDelegate() const { return m_cookieDelegate.get(); } + // content::StoragePartition::NetworkContextCreatedObserver overrides: + void OnNetworkContextCreated(content::StoragePartition *storage) override; // runs on ui thread + private: void removeBrowsingDataRemoverObserver(); @@ -109,7 +120,7 @@ private: int m_httpCacheMaxSize = 0; BrowsingDataRemoverObserverQt m_removerObserver; QString m_dataPath; - bool m_clearHttpCacheInProgress = false; + ClearHttpCacheState m_clearHttpCacheState = Completed; base::WeakPtrFactory<ProfileIODataQt> m_weakPtrFactory; // this should be always the last member friend class BrowsingDataRemoverObserverQt; |