AK: Rename AsyncStreamBuffer -> StreamBuffer

There is not nearly enough async-specific stuff in AsyncStreamBuffer for
it to carry "Async" prefix.
This commit is contained in:
Dan Klishch
2024-06-25 19:18:22 -04:00
committed by Ali Mohammad Pur
parent c3e13ce420
commit 3d3dd46618
3 changed files with 13 additions and 13 deletions

View File

@@ -11,17 +11,17 @@
namespace AK {
class AsyncStreamBuffer {
AK_MAKE_NONCOPYABLE(AsyncStreamBuffer);
class StreamBuffer {
AK_MAKE_NONCOPYABLE(StreamBuffer);
public:
AsyncStreamBuffer()
StreamBuffer()
{
m_capacity = min_capacity;
m_data = reinterpret_cast<u8*>(kmalloc(m_capacity));
}
AsyncStreamBuffer(AsyncStreamBuffer&& other)
StreamBuffer(StreamBuffer&& other)
: m_read_head(exchange(other.m_read_head, 0))
, m_peek_head(exchange(other.m_peek_head, 0))
, m_capacity(exchange(other.m_capacity, 0))
@@ -29,16 +29,16 @@ public:
{
}
AsyncStreamBuffer& operator=(AsyncStreamBuffer&& buffer)
StreamBuffer& operator=(StreamBuffer&& buffer)
{
if (this != &buffer) {
this->~AsyncStreamBuffer();
new (this) AsyncStreamBuffer(move(buffer));
this->~StreamBuffer();
new (this) StreamBuffer(move(buffer));
}
return *this;
}
~AsyncStreamBuffer()
~StreamBuffer()
{
if (m_data)
kfree_sized(m_data, m_capacity);
@@ -127,5 +127,5 @@ private:
}
#ifdef USING_AK_GLOBALLY
using AK::AsyncStreamBuffer;
using AK::StreamBuffer;
#endif

View File

@@ -4,10 +4,10 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/AsyncStreamBuffer.h>
#include <AK/AsyncStreamHelpers.h>
#include <AK/AsyncStreamTransform.h>
#include <AK/GenericLexer.h>
#include <AK/StreamBuffer.h>
#include <LibHTTP/Http11Connection.h>
namespace HTTP {
@@ -149,7 +149,7 @@ private:
}
}
AsyncStreamBuffer m_buffer;
StreamBuffer m_buffer;
};
}

View File

@@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/AsyncStreamBuffer.h>
#include <AK/AsyncStreamHelpers.h>
#include <AK/AsyncStreamTransform.h>
#include <AK/CharacterTypes.h>
@@ -13,6 +12,7 @@
#include <AK/GenericAwaiter.h>
#include <AK/MemMem.h>
#include <AK/MemoryStream.h>
#include <AK/StreamBuffer.h>
#include <AK/Try.h>
#include <LibCompress/Brotli.h>
#include <LibCompress/Gzip.h>
@@ -79,7 +79,7 @@ struct SyncStreamAsyncWrapper final : public AsyncInputStream {
private:
MaybeOwned<Stream> m_stream;
GenericAwaiter m_awaiter;
AsyncStreamBuffer m_buffer;
StreamBuffer m_buffer;
};
static ErrorOr<ByteBuffer> handle_content_encoding(ByteBuffer const& buf, ByteString const& content_encoding)