Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / performance / PerformanceWorker.h
blobf11affd5dde4d72608e2057fef91519b9d3ab24c
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"
11 #include "mozilla/dom/WorkerPrivate.h"
13 namespace mozilla {
14 namespace dom {
16 class PerformanceWorker final : public Performance {
17 public:
18 explicit PerformanceWorker(WorkerPrivate* aWorkerPrivate);
20 PerformanceStorage* AsPerformanceStorage() override {
21 MOZ_CRASH("This should not be called on workers.");
22 return nullptr;
25 virtual PerformanceTiming* Timing() override {
26 MOZ_CRASH("This should not be called on workers.");
27 return nullptr;
30 virtual PerformanceNavigation* Navigation() override {
31 MOZ_CRASH("This should not be called on workers.");
32 return nullptr;
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.");
50 return nullptr;
53 virtual uint64_t GetRandomTimelineSeed() override;
55 virtual nsITimedChannel* GetChannel() const override {
56 MOZ_CRASH("This should not be called on workers.");
57 return nullptr;
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");
84 bool CrossOriginIsolated() const override;
86 protected:
87 ~PerformanceWorker();
89 void InsertUserEntry(PerformanceEntry* aEntry) override;
91 void DispatchBufferFullEvent() override {
92 // Nothing to do here. See bug 1432758.
95 private:
96 CheckedUnsafePtr<WorkerPrivate> mWorkerPrivate;
99 } // namespace dom
100 } // namespace mozilla
102 #endif // mozilla_dom_PerformanceWorker_h