Line data Source code
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/. */
6 :
7 : #include "PerformanceNavigation.h"
8 : #include "PerformanceTiming.h"
9 : #include "mozilla/dom/PerformanceNavigationBinding.h"
10 :
11 : namespace mozilla {
12 : namespace dom {
13 :
14 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PerformanceNavigation, mPerformance)
15 :
16 0 : NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PerformanceNavigation, AddRef)
17 0 : NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PerformanceNavigation, Release)
18 :
19 0 : PerformanceNavigation::PerformanceNavigation(Performance* aPerformance)
20 0 : : mPerformance(aPerformance)
21 : {
22 0 : MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
23 0 : }
24 :
25 0 : PerformanceNavigation::~PerformanceNavigation()
26 : {
27 0 : }
28 :
29 : JSObject*
30 0 : PerformanceNavigation::WrapObject(JSContext *cx,
31 : JS::Handle<JSObject*> aGivenProto)
32 : {
33 0 : return PerformanceNavigationBinding::Wrap(cx, this, aGivenProto);
34 : }
35 :
36 : uint16_t
37 0 : PerformanceNavigation::RedirectCount() const
38 : {
39 0 : return GetPerformanceTiming()->GetRedirectCount();
40 : }
41 :
42 : } // dom namespace
43 : } // mozilla namespace
|