ProxyMappings.h 648 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/HashMap.h>
  8. #include <AK/URL.h>
  9. #include <AK/Vector.h>
  10. #include <LibCore/Proxy.h>
  11. namespace Web {
  12. class ProxyMappings {
  13. public:
  14. static ProxyMappings& the();
  15. Core::ProxyData proxy_for_url(AK::URL const&) const;
  16. void set_mappings(Vector<DeprecatedString> proxies, OrderedHashMap<DeprecatedString, size_t> mappings);
  17. private:
  18. ProxyMappings() = default;
  19. ~ProxyMappings() = default;
  20. Vector<DeprecatedString> m_proxies;
  21. OrderedHashMap<DeprecatedString, size_t> m_mappings;
  22. };
  23. }