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/. */
7 #ifndef mozilla_dom_PerformanceServerTiming_h
8 #define mozilla_dom_PerformanceServerTiming_h
10 #include "mozilla/Attributes.h"
12 #include "nsDOMNavigationTiming.h"
13 #include "nsWrapperCache.h"
16 class nsIServerTiming
;
22 class PerformanceServerTiming final
: public nsISupports
,
23 public nsWrapperCache
{
25 PerformanceServerTiming(nsISupports
* aParent
, nsIServerTiming
* aServerTiming
)
26 : mParent(aParent
), mServerTiming(aServerTiming
) {
27 MOZ_ASSERT(mServerTiming
);
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceServerTiming
)
33 JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 nsISupports
* GetParentObject() const { return mParent
; }
38 void GetName(nsAString
& aName
) const;
40 DOMHighResTimeStamp
Duration() const;
42 void GetDescription(nsAString
& aDescription
) const;
45 ~PerformanceServerTiming() = default;
47 nsCOMPtr
<nsISupports
> mParent
;
48 nsCOMPtr
<nsIServerTiming
> mServerTiming
;
52 } // namespace mozilla
54 #endif // mozilla_dom_PerformanceServerTiming_h