mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 07:10:57 +00:00 
			
		
		
		
	
		
			
	
	
		
			27 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			C++
		
	
	
	
	
	
		
		
			
		
	
	
			27 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| 
								 | 
							
								/*
							 | 
						||
| 
								 | 
							
								 * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * SPDX-License-Identifier: BSD-2-Clause
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <LibIPC/Decoder.h>
							 | 
						||
| 
								 | 
							
								#include <LibIPC/Encoder.h>
							 | 
						||
| 
								 | 
							
								#include <LibWebView/Attribute.h>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								template<>
							 | 
						||
| 
								 | 
							
								ErrorOr<void> IPC::encode(Encoder& encoder, WebView::Attribute const& attribute)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    TRY(encoder.encode(attribute.name));
							 | 
						||
| 
								 | 
							
								    TRY(encoder.encode(attribute.value));
							 | 
						||
| 
								 | 
							
								    return {};
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								template<>
							 | 
						||
| 
								 | 
							
								ErrorOr<WebView::Attribute> IPC::decode(Decoder& decoder)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    auto name = TRY(decoder.decode<String>());
							 | 
						||
| 
								 | 
							
								    auto value = TRY(decoder.decode<String>());
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    return WebView::Attribute { move(name), move(value) };
							 | 
						||
| 
								 | 
							
								}
							 |