dom/base/PerformanceEntry.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 #ifndef mozilla_dom_PerformanceEntry_h___
     7 #define mozilla_dom_PerformanceEntry_h___
     9 #include "nsPerformance.h"
    10 #include "nsDOMNavigationTiming.h"
    12 namespace mozilla {
    13 namespace dom {
    15 // http://www.w3.org/TR/performance-timeline/#performanceentry
    16 class PerformanceEntry : public nsISupports,
    17                          public nsWrapperCache
    18 {
    19 public:
    20   PerformanceEntry(nsPerformance* aPerformance);
    21   virtual ~PerformanceEntry();
    23   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    24   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry)
    26   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    28   nsPerformance* GetParentObject() const
    29   {
    30     return mPerformance;
    31   }
    33   void GetName(nsAString& aName) const
    34   {
    35     aName = mName;
    36   }
    38   const nsAString& GetName() const
    39   {
    40     return mName;
    41   }
    43   void SetName(const nsAString& aName)
    44   {
    45     mName = aName;
    46   }
    48   void GetEntryType(nsAString& aEntryType) const
    49   {
    50     aEntryType = mEntryType;
    51   }
    53   const nsAString& GetEntryType()
    54   {
    55     return mEntryType;
    56   }
    58   void SetEntryType(const nsAString& aEntryType)
    59   {
    60     mEntryType = aEntryType;
    61   }
    63   virtual DOMHighResTimeStamp StartTime() const
    64   {
    65     return 0;
    66   }
    68   virtual DOMHighResTimeStamp Duration() const
    69   {
    70     return 0;
    71   }
    73 protected:
    74   nsRefPtr<nsPerformance> mPerformance;
    75   nsString mName;
    76   nsString mEntryType;
    77 };
    79 } // namespace dom
    80 } // namespace mozilla
    82 #endif /* mozilla_dom_PerformanceEntry_h___ */

mercurial