mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
49
Libraries/LibJS/Runtime/DataView.h
Normal file
49
Libraries/LibJS/Runtime/DataView.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Runtime/ArrayBuffer.h>
|
||||
#include <LibJS/Runtime/ByteLength.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class DataView : public Object {
|
||||
JS_OBJECT(DataView, Object);
|
||||
JS_DECLARE_ALLOCATOR(DataView);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<DataView> create(Realm&, ArrayBuffer*, ByteLength byte_length, size_t byte_offset);
|
||||
|
||||
virtual ~DataView() override = default;
|
||||
|
||||
ArrayBuffer* viewed_array_buffer() const { return m_viewed_array_buffer; }
|
||||
ByteLength const& byte_length() const { return m_byte_length; }
|
||||
u32 byte_offset() const { return m_byte_offset; }
|
||||
|
||||
private:
|
||||
DataView(ArrayBuffer*, ByteLength byte_length, size_t byte_offset, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
GCPtr<ArrayBuffer> m_viewed_array_buffer;
|
||||
ByteLength m_byte_length { 0 };
|
||||
size_t m_byte_offset { 0 };
|
||||
};
|
||||
|
||||
// 25.3.1.1 DataView With Buffer Witness Records, https://tc39.es/ecma262/#sec-dataview-with-buffer-witness-records
|
||||
struct DataViewWithBufferWitness {
|
||||
NonnullGCPtr<DataView const> object; // [[Object]]
|
||||
ByteLength cached_buffer_byte_length; // [[CachedBufferByteLength]]
|
||||
};
|
||||
|
||||
DataViewWithBufferWitness make_data_view_with_buffer_witness_record(DataView const&, ArrayBuffer::Order);
|
||||
u32 get_view_byte_length(DataViewWithBufferWitness const&);
|
||||
bool is_view_out_of_bounds(DataViewWithBufferWitness const&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue