From 5ed66cb8d974c2254e1ea67046b690e414851df3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 1 Jun 2020 21:33:23 +0200 Subject: LibWeb: Start building a new Resource class to share more resources A Resource represents a resource that we're loading, have loaded or will soon load. Basically, it's a downloadable resource that can be shared by multiple clients. A typical usecase is multiple elements with the same src. In a future patch, we will try to make sure that those elements get the same Resource if possible. This will reduce network usage, memory usage, and CPU usage. :^) For now, this first patch simply introduces the mechanism. You get a Resource by calling ResourceLoader::load_resource(). To get notified about changes to a Resource's load status, you inherit from ResourceClient and implement the callbacks you're interested in. This patch turns HTMLImageElement into a ResourceClient. --- Libraries/LibWeb/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Libraries/LibWeb/CMakeLists.txt') diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 1474207ce1..92adb508df 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -83,6 +83,7 @@ set(SOURCES Layout/LayoutWidget.cpp Layout/LineBox.cpp Layout/LineBoxFragment.cpp + Loader/Resource.cpp Loader/ResourceLoader.cpp PageView.cpp Parser/CSSParser.cpp -- cgit v1.2.3