1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/base/PerformanceEntry.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,82 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_dom_PerformanceEntry_h___ 1.10 +#define mozilla_dom_PerformanceEntry_h___ 1.11 + 1.12 +#include "nsPerformance.h" 1.13 +#include "nsDOMNavigationTiming.h" 1.14 + 1.15 +namespace mozilla { 1.16 +namespace dom { 1.17 + 1.18 +// http://www.w3.org/TR/performance-timeline/#performanceentry 1.19 +class PerformanceEntry : public nsISupports, 1.20 + public nsWrapperCache 1.21 +{ 1.22 +public: 1.23 + PerformanceEntry(nsPerformance* aPerformance); 1.24 + virtual ~PerformanceEntry(); 1.25 + 1.26 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.27 + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry) 1.28 + 1.29 + virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; 1.30 + 1.31 + nsPerformance* GetParentObject() const 1.32 + { 1.33 + return mPerformance; 1.34 + } 1.35 + 1.36 + void GetName(nsAString& aName) const 1.37 + { 1.38 + aName = mName; 1.39 + } 1.40 + 1.41 + const nsAString& GetName() const 1.42 + { 1.43 + return mName; 1.44 + } 1.45 + 1.46 + void SetName(const nsAString& aName) 1.47 + { 1.48 + mName = aName; 1.49 + } 1.50 + 1.51 + void GetEntryType(nsAString& aEntryType) const 1.52 + { 1.53 + aEntryType = mEntryType; 1.54 + } 1.55 + 1.56 + const nsAString& GetEntryType() 1.57 + { 1.58 + return mEntryType; 1.59 + } 1.60 + 1.61 + void SetEntryType(const nsAString& aEntryType) 1.62 + { 1.63 + mEntryType = aEntryType; 1.64 + } 1.65 + 1.66 + virtual DOMHighResTimeStamp StartTime() const 1.67 + { 1.68 + return 0; 1.69 + } 1.70 + 1.71 + virtual DOMHighResTimeStamp Duration() const 1.72 + { 1.73 + return 0; 1.74 + } 1.75 + 1.76 +protected: 1.77 + nsRefPtr<nsPerformance> mPerformance; 1.78 + nsString mName; 1.79 + nsString mEntryType; 1.80 +}; 1.81 + 1.82 +} // namespace dom 1.83 +} // namespace mozilla 1.84 + 1.85 +#endif /* mozilla_dom_PerformanceEntry_h___ */