/* * Copyright (c) 2020-2023, Andreas Kling * Copyright (c) 2021-2023, Linus Groh * Copyright (c) 2023, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace WebContent { class PageHost { AK_MAKE_NONCOPYABLE(PageHost); AK_MAKE_NONMOVABLE(PageHost); public: static NonnullOwnPtr create(ConnectionFromClient& client) { return adopt_own(*new PageHost(client)); } virtual ~PageHost(); Optional page(u64 index); PageClient& create_page(); void remove_page(Badge, u64 index); ConnectionFromClient& client() const { return m_client; } private: explicit PageHost(ConnectionFromClient&); ConnectionFromClient& m_client; HashMap> m_pages; u64 m_next_id { 0 }; }; }