mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:22:45 +00:00 
			
		
		
		
	 feb7fbb95d
			
		
	
	
		feb7fbb95d
		
	
	
	
	
		
			
			The parameter in IDL is left as an unsigned long instead of an unsigned long long as the IDL generator does not currently support that.
		
			
				
	
	
		
			49 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Matthew Olsson <mattco@serenityos.org>
 | |
|  * Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibJS/Runtime/TypedArray.h>
 | |
| #include <LibWeb/Bindings/PlatformObject.h>
 | |
| #include <LibWeb/Forward.h>
 | |
| #include <LibWeb/Streams/ReadableByteStreamController.h>
 | |
| 
 | |
| namespace Web::Streams {
 | |
| 
 | |
| // https://streams.spec.whatwg.org/#readablestreambyobrequest
 | |
| class ReadableStreamBYOBRequest : public Bindings::PlatformObject {
 | |
|     WEB_PLATFORM_OBJECT(ReadableStreamBYOBRequest, Bindings::PlatformObject);
 | |
|     JS_DECLARE_ALLOCATOR(ReadableStreamBYOBRequest);
 | |
| 
 | |
| public:
 | |
|     virtual ~ReadableStreamBYOBRequest() override = default;
 | |
| 
 | |
|     JS::GCPtr<WebIDL::ArrayBufferView> view();
 | |
| 
 | |
|     void set_controller(JS::GCPtr<ReadableByteStreamController> value) { m_controller = value; }
 | |
| 
 | |
|     void set_view(JS::GCPtr<WebIDL::ArrayBufferView> value) { m_view = value; }
 | |
| 
 | |
|     WebIDL::ExceptionOr<void> respond(u64 bytes_written);
 | |
| 
 | |
| private:
 | |
|     explicit ReadableStreamBYOBRequest(JS::Realm&);
 | |
| 
 | |
|     virtual void initialize(JS::Realm&) override;
 | |
| 
 | |
|     virtual void visit_edges(Cell::Visitor&) override;
 | |
| 
 | |
|     // https://streams.spec.whatwg.org/#readablestreambyobrequest-controller
 | |
|     // The parent ReadableByteStreamController instance
 | |
|     JS::GCPtr<ReadableByteStreamController> m_controller;
 | |
| 
 | |
|     // https://streams.spec.whatwg.org/#readablestreambyobrequest-view
 | |
|     // A typed array representing the destination region to which the controller can write generated data, or null after the BYOB request has been invalidated.
 | |
|     JS::GCPtr<WebIDL::ArrayBufferView> m_view;
 | |
| };
 | |
| 
 | |
| }
 |