mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:52:43 +00:00 
			
		
		
		
	 c8d121fa32
			
		
	
	
		c8d121fa32
		
	
	
	
	
		
			
			This implements the following operations from section 4 of the Fetch spec (https://fetch.spec.whatwg.org/#fetching): - Fetch - Main fetch - Fetch response handover - Scheme fetch - HTTP fetch - HTTP-redirect fetch - HTTP-network-or-cache fetch (without caching) It does *not* implement: - HTTP-network fetch - CORS-preflight fetch Instead, we let ResourceLoader handle the actual networking for now, which isn't ideal, but certainly enough to get enough functionality up and running for most websites to not complain.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			598 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			598 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/RefCounted.h>
 | |
| 
 | |
| namespace Web::Fetch::Fetching {
 | |
| 
 | |
| /// A ref-counted boolean flag.
 | |
| /// This is used to share flags between multiple callback closures.
 | |
| class RefCountedFlag : public RefCounted<RefCountedFlag> {
 | |
| public:
 | |
|     static NonnullRefPtr<RefCountedFlag> create(bool);
 | |
| 
 | |
|     [[nodiscard]] bool value() const { return m_value; }
 | |
|     void set_value(bool value) { m_value = value; }
 | |
| 
 | |
| private:
 | |
|     explicit RefCountedFlag(bool);
 | |
| 
 | |
|     bool m_value { false };
 | |
| };
 | |
| 
 | |
| }
 |