Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / performance / PerformancePaintTiming.h
blobdc4dc7f632deea6081f793a0019596067813b061
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_PerformancePaintTiming_h___
8 #define mozilla_dom_PerformancePaintTiming_h___
10 #include "mozilla/dom/PerformanceEntry.h"
11 #include "mozilla/dom/PerformancePaintTimingBinding.h"
13 namespace mozilla {
14 namespace dom {
16 class Performance;
18 // https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
19 // Unlike timeToContentfulPaint, this timing is generated during
20 // displaylist building, when a frame is contentful, we collect
21 // the timestamp. Whereas, timeToContentfulPaint uses a compositor-side
22 // timestamp.
23 class PerformancePaintTiming final : public PerformanceEntry {
24 public:
25 PerformancePaintTiming(Performance* aPerformance, const nsAString& aName,
26 const TimeStamp& aStartTime);
28 NS_DECL_ISUPPORTS_INHERITED
30 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PerformancePaintTiming,
31 PerformanceEntry)
33 JSObject* WrapObject(JSContext* aCx,
34 JS::Handle<JSObject*> aGivenProto) override;
36 DOMHighResTimeStamp StartTime() const override;
38 size_t SizeOfIncludingThis(
39 mozilla::MallocSizeOf aMallocSizeOf) const override;
41 private:
42 ~PerformancePaintTiming();
43 RefPtr<Performance> mPerformance;
45 const TimeStamp mRawStarTime;
46 mutable Maybe<DOMHighResTimeStamp> mCachedStartTime;
49 } // namespace dom
50 } // namespace mozilla
52 #endif /* mozilla_dom_PerformanacePaintTiming_h___ */