PerformanceNavigation.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "PerformanceNavigation.h"
  6. #include "PerformanceTiming.h"
  7. #include "mozilla/dom/PerformanceNavigationBinding.h"
  8. namespace mozilla {
  9. namespace dom {
  10. NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PerformanceNavigation, mPerformance)
  11. NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PerformanceNavigation, AddRef)
  12. NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PerformanceNavigation, Release)
  13. PerformanceNavigation::PerformanceNavigation(Performance* aPerformance)
  14. : mPerformance(aPerformance)
  15. {
  16. MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
  17. }
  18. PerformanceNavigation::~PerformanceNavigation()
  19. {
  20. }
  21. JSObject*
  22. PerformanceNavigation::WrapObject(JSContext *cx,
  23. JS::Handle<JSObject*> aGivenProto)
  24. {
  25. return PerformanceNavigationBinding::Wrap(cx, this, aGivenProto);
  26. }
  27. uint16_t
  28. PerformanceNavigation::RedirectCount() const
  29. {
  30. return GetPerformanceTiming()->GetRedirectCount();
  31. }
  32. } // dom namespace
  33. } // mozilla namespace