no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / performance / PerformanceNavigation.cpp
blobbbfdd4a982d5ff6f2433b1b2f85bd4192e6303d9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "PerformanceNavigation.h"
8 #include "PerformanceTiming.h"
9 #include "mozilla/dom/PerformanceNavigationBinding.h"
11 namespace mozilla::dom {
13 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PerformanceNavigation, mPerformance)
15 PerformanceNavigation::PerformanceNavigation(Performance* aPerformance)
16 : mPerformance(aPerformance) {
17 MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
20 PerformanceNavigation::~PerformanceNavigation() = default;
22 JSObject* PerformanceNavigation::WrapObject(JSContext* cx,
23 JS::Handle<JSObject*> aGivenProto) {
24 return PerformanceNavigation_Binding::Wrap(cx, this, aGivenProto);
27 uint16_t PerformanceNavigation::RedirectCount() const {
28 return GetPerformanceTiming()->Data()->GetRedirectCount();
31 } // namespace mozilla::dom