EventLoopPlugin.cpp 469 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/Function.h>
  7. #include <LibWeb/Platform/EventLoopPlugin.h>
  8. namespace Web::Platform {
  9. EventLoopPlugin* s_the;
  10. EventLoopPlugin& EventLoopPlugin::the()
  11. {
  12. VERIFY(s_the);
  13. return *s_the;
  14. }
  15. void EventLoopPlugin::install(EventLoopPlugin& plugin)
  16. {
  17. VERIFY(!s_the);
  18. s_the = &plugin;
  19. }
  20. EventLoopPlugin::~EventLoopPlugin() = default;
  21. }