summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-25 20:19:05 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-29 19:16:44 -0700
commit093cf428a3d7473f429a589f1573d9ac1c41d762 (patch)
tree7314dbfc855b44470a78756e1e41f43bdd56d083 /Userland/Utilities
parent11550f582ba99d317717ef76fef23118fa226ee1 (diff)
downloadserenity-093cf428a3d7473f429a589f1573d9ac1c41d762.zip
AK: Move memory streams from `LibCore`
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/headless-browser.cpp13
-rw-r--r--Userland/Utilities/wasm.cpp6
2 files changed, 9 insertions, 10 deletions
diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp
index 61dd68acb9..526e05a363 100644
--- a/Userland/Utilities/headless-browser.cpp
+++ b/Userland/Utilities/headless-browser.cpp
@@ -16,7 +16,6 @@
#include <LibCore/ConfigFile.h>
#include <LibCore/EventLoop.h>
#include <LibCore/File.h>
-#include <LibCore/MemoryStream.h>
#include <LibCore/Stream.h>
#include <LibCore/System.h>
#include <LibCore/SystemServerTakeover.h>
@@ -343,7 +342,7 @@ public:
private:
HTTPHeadlessRequest(HTTP::HttpRequest&& request, NonnullOwnPtr<Core::Stream::BufferedSocketBase> socket, ByteBuffer&& stream_backing_buffer)
: m_stream_backing_buffer(move(stream_backing_buffer))
- , m_output_stream(Core::Stream::FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
+ , m_output_stream(FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
, m_socket(move(socket))
, m_job(HTTP::Job::construct(move(request), *m_output_stream))
{
@@ -369,7 +368,7 @@ public:
Optional<u32> m_response_code;
ByteBuffer m_stream_backing_buffer;
- NonnullOwnPtr<Core::Stream::FixedMemoryStream> m_output_stream;
+ NonnullOwnPtr<FixedMemoryStream> m_output_stream;
NonnullOwnPtr<Core::Stream::BufferedSocketBase> m_socket;
NonnullRefPtr<HTTP::Job> m_job;
HashMap<DeprecatedString, DeprecatedString, CaseInsensitiveStringTraits> m_response_headers;
@@ -422,7 +421,7 @@ public:
private:
HTTPSHeadlessRequest(HTTP::HttpRequest&& request, NonnullOwnPtr<Core::Stream::BufferedSocketBase> socket, ByteBuffer&& stream_backing_buffer)
: m_stream_backing_buffer(move(stream_backing_buffer))
- , m_output_stream(Core::Stream::FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
+ , m_output_stream(FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
, m_socket(move(socket))
, m_job(HTTP::HttpsJob::construct(move(request), *m_output_stream))
{
@@ -448,7 +447,7 @@ public:
Optional<u32> m_response_code;
ByteBuffer m_stream_backing_buffer;
- NonnullOwnPtr<Core::Stream::FixedMemoryStream> m_output_stream;
+ NonnullOwnPtr<FixedMemoryStream> m_output_stream;
NonnullOwnPtr<Core::Stream::BufferedSocketBase> m_socket;
NonnullRefPtr<HTTP::HttpsJob> m_job;
HashMap<DeprecatedString, DeprecatedString, CaseInsensitiveStringTraits> m_response_headers;
@@ -491,7 +490,7 @@ public:
private:
GeminiHeadlessRequest(Gemini::GeminiRequest&& request, NonnullOwnPtr<Core::Stream::BufferedSocketBase> socket, ByteBuffer&& stream_backing_buffer)
: m_stream_backing_buffer(move(stream_backing_buffer))
- , m_output_stream(Core::Stream::FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
+ , m_output_stream(FixedMemoryStream::construct(m_stream_backing_buffer.bytes()).release_value_but_fixme_should_propagate_errors())
, m_socket(move(socket))
, m_job(Gemini::Job::construct(move(request), *m_output_stream))
{
@@ -517,7 +516,7 @@ public:
Optional<u32> m_response_code;
ByteBuffer m_stream_backing_buffer;
- NonnullOwnPtr<Core::Stream::FixedMemoryStream> m_output_stream;
+ NonnullOwnPtr<FixedMemoryStream> m_output_stream;
NonnullOwnPtr<Core::Stream::BufferedSocketBase> m_socket;
NonnullRefPtr<Gemini::Job> m_job;
HashMap<DeprecatedString, DeprecatedString, CaseInsensitiveStringTraits> m_response_headers;
diff --git a/Userland/Utilities/wasm.cpp b/Userland/Utilities/wasm.cpp
index e08a2484b1..0ec6e4ca76 100644
--- a/Userland/Utilities/wasm.cpp
+++ b/Userland/Utilities/wasm.cpp
@@ -5,10 +5,10 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/MemoryStream.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
-#include <LibCore/MemoryStream.h>
#include <LibLine/Editor.h>
#include <LibMain/Main.h>
#include <LibWasm/AbstractMachine/AbstractMachine.h>
@@ -252,7 +252,7 @@ static Optional<Wasm::Module> parse(StringView filename)
return {};
}
- auto stream = Core::Stream::FixedMemoryStream::construct(ReadonlyBytes { result.value()->data(), result.value()->size() }).release_value_but_fixme_should_propagate_errors();
+ auto stream = FixedMemoryStream::construct(ReadonlyBytes { result.value()->data(), result.value()->size() }).release_value_but_fixme_should_propagate_errors();
auto parse_result = Wasm::Module::parse(*stream);
if (parse_result.is_error()) {
warnln("Something went wrong, either the file is invalid, or there's a bug with LibWasm!");
@@ -398,7 +398,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
StringBuilder argument_builder;
bool first = true;
for (auto& argument : arguments) {
- Core::Stream::AllocatingMemoryStream stream;
+ AllocatingMemoryStream stream;
Wasm::Printer { stream }.print(argument);
if (first)
first = false;