/src/serenity/Userland/Libraries/LibWeb/Loader/ProxyMappings.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/HashMap.h> |
10 | | #include <AK/Vector.h> |
11 | | #include <LibCore/Proxy.h> |
12 | | #include <LibURL/URL.h> |
13 | | |
14 | | namespace Web { |
15 | | |
16 | | class ProxyMappings { |
17 | | public: |
18 | | static ProxyMappings& the(); |
19 | | |
20 | | Core::ProxyData proxy_for_url(URL::URL const&) const; |
21 | | void set_mappings(Vector<ByteString> proxies, OrderedHashMap<ByteString, size_t> mappings); |
22 | | |
23 | | private: |
24 | 0 | ProxyMappings() = default; |
25 | 0 | ~ProxyMappings() = default; |
26 | | |
27 | | Vector<ByteString> m_proxies; |
28 | | OrderedHashMap<ByteString, size_t> m_mappings; |
29 | | }; |
30 | | |
31 | | } |