michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_PerformanceEntry_h___ michael@0: #define mozilla_dom_PerformanceEntry_h___ michael@0: michael@0: #include "nsPerformance.h" michael@0: #include "nsDOMNavigationTiming.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: // http://www.w3.org/TR/performance-timeline/#performanceentry michael@0: class PerformanceEntry : public nsISupports, michael@0: public nsWrapperCache michael@0: { michael@0: public: michael@0: PerformanceEntry(nsPerformance* aPerformance); michael@0: virtual ~PerformanceEntry(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry) michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; michael@0: michael@0: nsPerformance* GetParentObject() const michael@0: { michael@0: return mPerformance; michael@0: } michael@0: michael@0: void GetName(nsAString& aName) const michael@0: { michael@0: aName = mName; michael@0: } michael@0: michael@0: const nsAString& GetName() const michael@0: { michael@0: return mName; michael@0: } michael@0: michael@0: void SetName(const nsAString& aName) michael@0: { michael@0: mName = aName; michael@0: } michael@0: michael@0: void GetEntryType(nsAString& aEntryType) const michael@0: { michael@0: aEntryType = mEntryType; michael@0: } michael@0: michael@0: const nsAString& GetEntryType() michael@0: { michael@0: return mEntryType; michael@0: } michael@0: michael@0: void SetEntryType(const nsAString& aEntryType) michael@0: { michael@0: mEntryType = aEntryType; michael@0: } michael@0: michael@0: virtual DOMHighResTimeStamp StartTime() const michael@0: { michael@0: return 0; michael@0: } michael@0: michael@0: virtual DOMHighResTimeStamp Duration() const michael@0: { michael@0: return 0; michael@0: } michael@0: michael@0: protected: michael@0: nsRefPtr mPerformance; michael@0: nsString mName; michael@0: nsString mEntryType; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif /* mozilla_dom_PerformanceEntry_h___ */