mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	 6e19ab2bbc
			
		
	
	
		6e19ab2bbc
		
	
	
	
	
		
			
			We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/HashMap.h>
 | |
| #include <LibIPC/ConnectionToServer.h>
 | |
| #include <RequestServer/RequestClientEndpoint.h>
 | |
| #include <RequestServer/RequestServerEndpoint.h>
 | |
| 
 | |
| namespace Protocol {
 | |
| 
 | |
| class Request;
 | |
| 
 | |
| class RequestClient final
 | |
|     : public IPC::ConnectionToServer<RequestClientEndpoint, RequestServerEndpoint>
 | |
|     , public RequestClientEndpoint {
 | |
|     IPC_CLIENT_CONNECTION(RequestClient, "/tmp/session/%sid/portal/request"sv)
 | |
| 
 | |
| public:
 | |
|     template<typename RequestHashMapTraits = Traits<DeprecatedString>>
 | |
|     RefPtr<Request> start_request(DeprecatedString const& method, URL const&, HashMap<DeprecatedString, DeprecatedString, RequestHashMapTraits> const& request_headers = {}, ReadonlyBytes request_body = {}, Core::ProxyData const& = {});
 | |
| 
 | |
|     void ensure_connection(URL const&, ::RequestServer::CacheLevel);
 | |
| 
 | |
|     bool stop_request(Badge<Request>, Request&);
 | |
|     bool set_certificate(Badge<Request>, Request&, DeprecatedString, DeprecatedString);
 | |
| 
 | |
| private:
 | |
|     RequestClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
 | |
| 
 | |
|     virtual void request_progress(i32, Optional<u32> const&, u32) override;
 | |
|     virtual void request_finished(i32, bool, u32) override;
 | |
|     virtual void certificate_requested(i32) override;
 | |
|     virtual void headers_became_available(i32, IPC::Dictionary const&, Optional<u32> const&) override;
 | |
| 
 | |
|     HashMap<i32, RefPtr<Request>> m_requests;
 | |
| };
 | |
| 
 | |
| }
 |