PerformanceEntry.cpp 907 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/Bindings/PerformanceEntryPrototype.h>
  8. #include <LibWeb/PerformanceTimeline/PerformanceEntry.h>
  9. namespace Web::PerformanceTimeline {
  10. PerformanceEntry::PerformanceEntry(JS::Realm& realm, String const& name, HighResolutionTime::DOMHighResTimeStamp start_time, HighResolutionTime::DOMHighResTimeStamp duration)
  11. : Bindings::PlatformObject(realm)
  12. , m_name(name)
  13. , m_start_time(start_time)
  14. , m_duration(duration)
  15. {
  16. }
  17. PerformanceEntry::~PerformanceEntry() = default;
  18. JS::ThrowCompletionOr<void> PerformanceEntry::initialize(JS::Realm& realm)
  19. {
  20. MUST_OR_THROW_OOM(Base::initialize(realm));
  21. set_prototype(&Bindings::ensure_web_prototype<Bindings::PerformanceEntryPrototype>(realm, "PerformanceEntry"));
  22. return {};
  23. }
  24. }