summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Loader/ResourceLoader.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-08-05 14:09:38 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-06 10:33:16 +0200
commitb3d1a05261b62cb880963e5c3b3d9cdf57146eb4 (patch)
treecf34eaa4643f17484af4f7343a4fcb891d79c9ba /Libraries/LibWeb/Loader/ResourceLoader.cpp
parentac9f6fd1f8e235039fa3416f6ed68d07cbbf896c (diff)
downloadserenity-b3d1a05261b62cb880963e5c3b3d9cdf57146eb4.zip
Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
Diffstat (limited to 'Libraries/LibWeb/Loader/ResourceLoader.cpp')
-rw-r--r--Libraries/LibWeb/Loader/ResourceLoader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Libraries/LibWeb/Loader/ResourceLoader.cpp
index 04c2349fc1..48eff645d7 100644
--- a/Libraries/LibWeb/Loader/ResourceLoader.cpp
+++ b/Libraries/LibWeb/Loader/ResourceLoader.cpp
@@ -117,7 +117,7 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&, const
if (url.protocol() == "about") {
dbg() << "Loading about: URL " << url;
deferred_invoke([success_callback = move(success_callback)](auto&) {
- success_callback(ByteBuffer::wrap(String::empty().characters(), 1), {});
+ success_callback(ByteBuffer::wrap(const_cast<char*>(String::empty().characters()), 1), {});
});
return;
}