mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:07:35 +00:00
LibProtocol: Remove use of ByteBuffer::wrap() in protocol API
This commit is contained in:
parent
77515fead2
commit
685d5f4e25
6 changed files with 10 additions and 10 deletions
|
@ -46,11 +46,11 @@ void Download::did_finish(Badge<Client>, bool success, Optional<u32> status_code
|
|||
if (!on_finish)
|
||||
return;
|
||||
|
||||
ByteBuffer payload;
|
||||
ReadonlyBytes payload;
|
||||
RefPtr<SharedBuffer> shared_buffer;
|
||||
if (success && shbuf_id != -1) {
|
||||
shared_buffer = SharedBuffer::create_from_shbuf_id(shbuf_id);
|
||||
payload = ByteBuffer::wrap(shared_buffer->data<void>(), total_size);
|
||||
payload = { shared_buffer->data<void>(), total_size };
|
||||
}
|
||||
|
||||
// FIXME: It's a bit silly that we copy the response headers here just so we can move them into a HashMap with different traits.
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
int id() const { return m_download_id; }
|
||||
bool stop();
|
||||
|
||||
Function<void(bool success, const ByteBuffer& payload, RefPtr<SharedBuffer> payload_storage, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> on_finish;
|
||||
Function<void(bool success, ReadonlyBytes payload, RefPtr<SharedBuffer> payload_storage, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> on_finish;
|
||||
Function<void(Optional<u32> total_size, u32 downloaded_size)> on_progress;
|
||||
Function<CertificateAndKey()> on_certificate_requested;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue