mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:17:45 +00:00
AK: Move memory streams from LibCore
This commit is contained in:
parent
11550f582b
commit
093cf428a3
46 changed files with 213 additions and 203 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue