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_PerformanceWorker_h
8 #define mozilla_dom_PerformanceWorker_h
10 #include "Performance.h"
12 namespace mozilla::dom
{
14 class WorkerGlobalScope
;
16 class PerformanceWorker final
: public Performance
{
18 explicit PerformanceWorker(WorkerGlobalScope
* aGlobalScope
);
20 PerformanceStorage
* AsPerformanceStorage() override
{
21 MOZ_CRASH("This should not be called on workers.");
25 virtual PerformanceTiming
* Timing() override
{
26 MOZ_CRASH("This should not be called on workers.");
30 virtual PerformanceNavigation
* Navigation() override
{
31 MOZ_CRASH("This should not be called on workers.");
35 virtual void SetFCPTimingEntry(PerformancePaintTiming
* aEntry
) override
{
36 MOZ_CRASH("This should not be called on workers.");
39 TimeStamp
CreationTimeStamp() const override
;
41 DOMHighResTimeStamp
CreationTime() const override
;
43 virtual void GetMozMemory(JSContext
* aCx
,
44 JS::MutableHandle
<JSObject
*> aObj
) override
{
45 MOZ_CRASH("This should not be called on workers.");
48 virtual nsDOMNavigationTiming
* GetDOMTiming() const override
{
49 MOZ_CRASH("This should not be called on workers.");
53 virtual uint64_t GetRandomTimelineSeed() override
;
55 virtual nsITimedChannel
* GetChannel() const override
{
56 MOZ_CRASH("This should not be called on workers.");
60 void QueueNavigationTimingEntry() override
{
61 MOZ_CRASH("This should not be called on workers.");
64 void UpdateNavigationTimingEntry() override
{
65 MOZ_CRASH("This should not be called on workers.");
68 void InsertEventTimingEntry(PerformanceEventTiming
*) override
{
69 MOZ_CRASH("This should not be called on workers.");
72 void BufferEventTimingEntryIfNeeded(PerformanceEventTiming
*) override
{
73 MOZ_CRASH("This should not be called on workers.");
76 void DispatchPendingEventTimingEntries() override
{
77 MOZ_CRASH("This should not be called on workders.");
80 class EventCounts
* EventCounts() override
{
81 MOZ_CRASH("This should not be called on workers");
87 void InsertUserEntry(PerformanceEntry
* aEntry
) override
;
89 void DispatchBufferFullEvent() override
{
90 // Nothing to do here. See bug 1432758.
94 } // namespace mozilla::dom
96 #endif // mozilla_dom_PerformanceWorker_h