/src/mozilla-central/dom/performance/PerformanceWorker.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_PerformanceWorker_h |
8 | | #define mozilla_dom_PerformanceWorker_h |
9 | | |
10 | | #include "Performance.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | class WorkerPrivate; |
16 | | |
17 | | class PerformanceWorker final : public Performance |
18 | | { |
19 | | public: |
20 | | explicit PerformanceWorker(WorkerPrivate* aWorkerPrivate); |
21 | | |
22 | | PerformanceStorage* AsPerformanceStorage() override |
23 | 0 | { |
24 | 0 | MOZ_CRASH("This should not be called on workers."); |
25 | 0 | return nullptr; |
26 | 0 | } |
27 | | |
28 | | virtual PerformanceTiming* Timing() override |
29 | 0 | { |
30 | 0 | MOZ_CRASH("This should not be called on workers."); |
31 | 0 | return nullptr; |
32 | 0 | } |
33 | | |
34 | | virtual PerformanceNavigation* Navigation() override |
35 | 0 | { |
36 | 0 | MOZ_CRASH("This should not be called on workers."); |
37 | 0 | return nullptr; |
38 | 0 | } |
39 | | |
40 | | TimeStamp CreationTimeStamp() const override; |
41 | | |
42 | | DOMHighResTimeStamp CreationTime() const override; |
43 | | |
44 | | virtual void GetMozMemory(JSContext *aCx, |
45 | | JS::MutableHandle<JSObject*> aObj) override |
46 | 0 | { |
47 | 0 | MOZ_CRASH("This should not be called on workers."); |
48 | 0 | } |
49 | | |
50 | | virtual nsDOMNavigationTiming* GetDOMTiming() const override |
51 | 0 | { |
52 | 0 | MOZ_CRASH("This should not be called on workers."); |
53 | 0 | return nullptr; |
54 | 0 | } |
55 | | |
56 | | virtual uint64_t GetRandomTimelineSeed() override; |
57 | | |
58 | | virtual nsITimedChannel* GetChannel() const override |
59 | 0 | { |
60 | 0 | MOZ_CRASH("This should not be called on workers."); |
61 | 0 | return nullptr; |
62 | 0 | } |
63 | | |
64 | | void QueueNavigationTimingEntry() override |
65 | 0 | { |
66 | 0 | MOZ_CRASH("This should not be called on workers."); |
67 | 0 | } |
68 | | |
69 | | protected: |
70 | | ~PerformanceWorker(); |
71 | | |
72 | | void InsertUserEntry(PerformanceEntry* aEntry) override; |
73 | | |
74 | | void DispatchBufferFullEvent() override |
75 | 0 | { |
76 | 0 | // Nothing to do here. See bug 1432758. |
77 | 0 | } |
78 | | |
79 | | private: |
80 | | WorkerPrivate* mWorkerPrivate; |
81 | | }; |
82 | | |
83 | | } // namespace dom |
84 | | } // namespace mozilla |
85 | | |
86 | | #endif // mozilla_dom_PerformanceWorker_h |