mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
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:
committed by
Ali Mohammad Pur
parent
c3e13ce420
commit
3d3dd46618
@@ -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
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user