diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-03-29 15:31:09 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-30 10:27:49 +0200 |
commit | 855920fe136efe27c758a13ba8231690cd7052b8 (patch) | |
tree | 5b648c3419a55a476cdc21f95e96f04304061789 /Userland/Libraries/LibWeb/Loader | |
parent | 50a8e0e49507b2f6400618bdcb19f4387ce4ee2c (diff) | |
download | serenity-855920fe136efe27c758a13ba8231690cd7052b8.zip |
Browser+LibWeb+WebContent: Add action to clear resource cache
Diffstat (limited to 'Userland/Libraries/LibWeb/Loader')
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/ResourceLoader.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index f151a9cfab..49b5e48ce6 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -236,4 +236,10 @@ bool ResourceLoader::is_port_blocked(int port) return false; } +void ResourceLoader::clear_cache() +{ + dbgln("Clearing {} items from ResourceLoader cache", s_resource_cache.size()); + s_resource_cache.clear(); +} + } diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.h b/Userland/Libraries/LibWeb/Loader/ResourceLoader.h index 5fe23adc8a..ad23dd8da1 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.h +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.h @@ -56,6 +56,8 @@ public: const String& user_agent() const { return m_user_agent; } + void clear_cache(); + private: ResourceLoader(); static bool is_port_blocked(int port); |