Line data Source code
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_PerformanceMainThread_h
8 : #define mozilla_dom_PerformanceMainThread_h
9 :
10 : #include "Performance.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class PerformanceMainThread final : public Performance
16 : {
17 : public:
18 : PerformanceMainThread(nsPIDOMWindowInner* aWindow,
19 : nsDOMNavigationTiming* aDOMTiming,
20 : nsITimedChannel* aChannel);
21 :
22 : NS_DECL_ISUPPORTS_INHERITED
23 133 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(PerformanceMainThread,
24 : Performance)
25 :
26 : virtual PerformanceTiming* Timing() override;
27 :
28 : virtual PerformanceNavigation* Navigation() override;
29 :
30 : virtual void AddEntry(nsIHttpChannel* channel,
31 : nsITimedChannel* timedChannel) override;
32 :
33 : TimeStamp CreationTimeStamp() const override;
34 :
35 : DOMHighResTimeStamp CreationTime() const override;
36 :
37 : virtual void GetMozMemory(JSContext *aCx,
38 : JS::MutableHandle<JSObject*> aObj) override;
39 :
40 93 : virtual nsDOMNavigationTiming* GetDOMTiming() const override
41 : {
42 93 : return mDOMTiming;
43 : }
44 :
45 0 : virtual nsITimedChannel* GetChannel() const override
46 : {
47 0 : return mChannel;
48 : }
49 :
50 : protected:
51 : ~PerformanceMainThread();
52 :
53 0 : nsISupports* GetAsISupports() override
54 : {
55 0 : return this;
56 : }
57 :
58 : void InsertUserEntry(PerformanceEntry* aEntry) override;
59 :
60 : bool IsPerformanceTimingAttribute(const nsAString& aName) override;
61 :
62 : DOMHighResTimeStamp
63 : GetPerformanceTimingFromString(const nsAString& aTimingName) override;
64 :
65 : void DispatchBufferFullEvent() override;
66 :
67 : RefPtr<nsDOMNavigationTiming> mDOMTiming;
68 : nsCOMPtr<nsITimedChannel> mChannel;
69 : RefPtr<PerformanceTiming> mTiming;
70 : RefPtr<PerformanceNavigation> mNavigation;
71 : JS::Heap<JSObject*> mMozMemory;
72 : };
73 :
74 : } // namespace dom
75 : } // namespace mozilla
76 :
77 : #endif // mozilla_dom_PerformanceMainThread_h
|