/src/mozilla-central/dom/performance/PerformanceServerTiming.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef mozilla_dom_PerformanceServerTiming_h |
8 | | #define mozilla_dom_PerformanceServerTiming_h |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsWrapperCache.h" |
12 | | #include "nsString.h" |
13 | | |
14 | | class nsIServerTiming; |
15 | | class nsISupports; |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | class PerformanceServerTiming final : public nsISupports, |
21 | | public nsWrapperCache |
22 | | { |
23 | | public: |
24 | | PerformanceServerTiming(nsISupports* aParent, nsIServerTiming* aServerTiming) |
25 | | : mParent(aParent) |
26 | | , mServerTiming(aServerTiming) |
27 | 0 | { |
28 | 0 | MOZ_ASSERT(mServerTiming); |
29 | 0 | } |
30 | | |
31 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
32 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceServerTiming) |
33 | | |
34 | | JSObject* |
35 | | WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
36 | | |
37 | | nsISupports* GetParentObject() const |
38 | | { |
39 | | return mParent; |
40 | | } |
41 | | |
42 | | void GetName(nsAString& aName) const; |
43 | | |
44 | | DOMHighResTimeStamp Duration() const; |
45 | | |
46 | | void GetDescription(nsAString& aDescription) const; |
47 | | |
48 | | private: |
49 | 0 | ~PerformanceServerTiming() = default; |
50 | | |
51 | | nsCOMPtr<nsISupports> mParent; |
52 | | nsCOMPtr<nsIServerTiming> mServerTiming; |
53 | | }; |
54 | | |
55 | | } // namespace dom |
56 | | } // namespace mozilla |
57 | | |
58 | | #endif // mozilla_dom_PerformanceServerTiming_h |