mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 11:09:05 +03:00
LibWeb: Assert that we don't reuse cached resources with wrong type
This commit is contained in:
parent
5dc8c4a24c
commit
f2aa21ebc4
Notes:
sideshowbarker
2024-07-19 05:48:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f2aa21ebc41
@ -79,8 +79,12 @@ RefPtr<Resource> ResourceLoader::load_resource(Resource::Type type, const LoadRe
|
||||
|
||||
auto it = s_resource_cache.find(request);
|
||||
if (it != s_resource_cache.end()) {
|
||||
dbg() << "Reusing cached resource for: " << request.url();
|
||||
return it->value;
|
||||
if (it->value->type() != type) {
|
||||
dbg() << "FIXME: Not using cached resource for " << request.url() << " since there's a type mismatch.";
|
||||
} else {
|
||||
dbg() << "Reusing cached resource for: " << request.url();
|
||||
return it->value;
|
||||
}
|
||||
}
|
||||
|
||||
auto resource = Resource::create({}, type, request);
|
||||
|
Loading…
Reference in New Issue
Block a user