dom/base/PerformanceResourceTiming.cpp

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 2; 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/. */
     6 #include "PerformanceResourceTiming.h"
     7 #include "mozilla/dom/PerformanceResourceTimingBinding.h"
     9 using namespace mozilla::dom;
    11 NS_IMPL_CYCLE_COLLECTION_INHERITED(PerformanceResourceTiming,
    12                                    PerformanceEntry,
    13                                    mTiming)
    15 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(PerformanceResourceTiming,
    16                                                PerformanceEntry)
    17 NS_IMPL_CYCLE_COLLECTION_TRACE_END
    19 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(PerformanceResourceTiming)
    20 NS_INTERFACE_MAP_END_INHERITING(PerformanceEntry)
    22 NS_IMPL_ADDREF_INHERITED(PerformanceResourceTiming, PerformanceEntry)
    23 NS_IMPL_RELEASE_INHERITED(PerformanceResourceTiming, PerformanceEntry)
    25 PerformanceResourceTiming::PerformanceResourceTiming(nsPerformanceTiming* aPerformanceTiming,
    26                                                      nsPerformance* aPerformance)
    27 : PerformanceEntry(aPerformance),
    28   mTiming(aPerformanceTiming)
    29 {
    30   MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
    31 }
    33 PerformanceResourceTiming::~PerformanceResourceTiming()
    34 {
    35 }
    37 DOMHighResTimeStamp
    38 PerformanceResourceTiming::StartTime() const
    39 {
    40   DOMHighResTimeStamp startTime = mTiming->RedirectStartHighRes();
    41   return startTime ? startTime : mTiming->FetchStartHighRes();
    42 }
    44 JSObject*
    45 PerformanceResourceTiming::WrapObject(JSContext* aCx)
    46 {
    47   return PerformanceResourceTimingBinding::Wrap(aCx, this);
    48 }

mercurial