mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:12:45 +00:00 
			
		
		
		
	 04c094343f
			
		
	
	
		04c094343f
		
	
	
	
	
		
			
			These wrappers will make it much easier to do various operations on the different ArrayBuffer-related classes in LibWeb compared to the current solution, which is to just accept a Handle<Object> everywhere (and use "any" in the *.idl files). Co-Authored-By: Matthew Olsson <mattco@serenityos.org>
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			735 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			735 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibJS/Forward.h>
 | |
| #include <LibWeb/Bindings/PlatformObject.h>
 | |
| 
 | |
| namespace Web::Crypto {
 | |
| 
 | |
| class SubtleCrypto final : public Bindings::PlatformObject {
 | |
|     WEB_PLATFORM_OBJECT(SubtleCrypto, Bindings::PlatformObject);
 | |
|     JS_DECLARE_ALLOCATOR(SubtleCrypto);
 | |
| 
 | |
| public:
 | |
|     [[nodiscard]] static JS::NonnullGCPtr<SubtleCrypto> create(JS::Realm&);
 | |
| 
 | |
|     virtual ~SubtleCrypto() override;
 | |
| 
 | |
|     JS::NonnullGCPtr<JS::Promise> digest(String const& algorithm, JS::Handle<WebIDL::BufferSource> const& data);
 | |
| 
 | |
| private:
 | |
|     explicit SubtleCrypto(JS::Realm&);
 | |
|     virtual void initialize(JS::Realm&) override;
 | |
| };
 | |
| 
 | |
| }
 |