mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 21:30:58 +00:00 
			
		
		
		
	AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of the system, as LibCore depends on LibURL. This change has two main benefits: * Moving AK back more towards being an agnostic library that can be used between the kernel and userspace. URL has never really fit that description - and is not used in the kernel. * URL _should_ depend on LibUnicode, as it needs punnycode support. However, it's not really possible to do this inside of AK as it can't depend on any external library. This change brings us a little closer to being able to do that, but unfortunately we aren't there quite yet, as the code generators depend on LibCore.
This commit is contained in:
		
							parent
							
								
									21bfa001b1
								
							
						
					
					
						commit
						e800605ad3
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-17 04:41:05 +09:00 
				
			
			Author: https://github.com/shannonbooth
Commit: e800605ad3
Pull-request: https://github.com/SerenityOS/serenity/pull/23443
Issue: https://github.com/SerenityOS/serenity/issues/22884
Reviewed-by: https://github.com/trflynn89
			
					 403 changed files with 1336 additions and 1305 deletions
				
			
		|  | @ -6,22 +6,22 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <AK/URL.h> | ||||
| #include <LibJS/Heap/Cell.h> | ||||
| #include <LibJS/Heap/HeapFunction.h> | ||||
| #include <LibURL/URL.h> | ||||
| #include <LibWeb/HTML/Scripting/ModuleScript.h> | ||||
| 
 | ||||
| namespace Web::HTML { | ||||
| 
 | ||||
| class ModuleLocationTuple { | ||||
| public: | ||||
|     ModuleLocationTuple(URL url, ByteString type) | ||||
|     ModuleLocationTuple(URL::URL url, ByteString type) | ||||
|         : m_url(move(url)) | ||||
|         , m_type(move(type)) | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|     URL const& url() const { return m_url; } | ||||
|     URL::URL const& url() const { return m_url; } | ||||
|     ByteString const& type() const { return m_type; } | ||||
| 
 | ||||
|     bool operator==(ModuleLocationTuple const& other) const | ||||
|  | @ -30,7 +30,7 @@ public: | |||
|     } | ||||
| 
 | ||||
| private: | ||||
|     URL m_url; | ||||
|     URL::URL m_url; | ||||
|     ByteString m_type; | ||||
| }; | ||||
| 
 | ||||
|  | @ -56,16 +56,16 @@ public: | |||
| 
 | ||||
|     using CallbackFunction = JS::NonnullGCPtr<JS::HeapFunction<void(Entry)>>; | ||||
| 
 | ||||
|     bool is_fetching(URL const& url, ByteString const& type) const; | ||||
|     bool is_failed(URL const& url, ByteString const& type) const; | ||||
|     bool is_fetching(URL::URL const& url, ByteString const& type) const; | ||||
|     bool is_failed(URL::URL const& url, ByteString const& type) const; | ||||
| 
 | ||||
|     bool is(URL const& url, ByteString const& type, EntryType) const; | ||||
|     bool is(URL::URL const& url, ByteString const& type, EntryType) const; | ||||
| 
 | ||||
|     Optional<Entry> get(URL const& url, ByteString const& type) const; | ||||
|     Optional<Entry> get(URL::URL const& url, ByteString const& type) const; | ||||
| 
 | ||||
|     AK::HashSetResult set(URL const& url, ByteString const& type, Entry); | ||||
|     AK::HashSetResult set(URL::URL const& url, ByteString const& type, Entry); | ||||
| 
 | ||||
|     void wait_for_change(JS::Heap&, URL const& url, ByteString const& type, Function<void(Entry)> callback); | ||||
|     void wait_for_change(JS::Heap&, URL::URL const& url, ByteString const& type, Function<void(Entry)> callback); | ||||
| 
 | ||||
| private: | ||||
|     virtual void visit_edges(JS::Cell::Visitor&) override; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Shannon Booth
						Shannon Booth