Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / dom / performance / PerformanceMeasure.h
blob7ac9ceb16d403f0a8b9bfd8673246f055d731a17
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_performancemeasure_h___
8 #define mozilla_dom_performancemeasure_h___
10 #include "mozilla/dom/PerformanceEntry.h"
12 namespace mozilla::dom {
14 // http://www.w3.org/TR/user-timing/#performancemeasure
15 class PerformanceMeasure final : public PerformanceEntry {
16 public:
17 NS_DECL_ISUPPORTS_INHERITED
18 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(PerformanceMeasure,
19 PerformanceEntry);
21 PerformanceMeasure(nsISupports* aParent, const nsAString& aName,
22 DOMHighResTimeStamp aStartTime,
23 DOMHighResTimeStamp aEndTime,
24 const JS::Handle<JS::Value>& aDetail);
26 virtual JSObject* WrapObject(JSContext* aCx,
27 JS::Handle<JSObject*> aGivenProto) override;
29 virtual DOMHighResTimeStamp StartTime() const override { return mStartTime; }
31 virtual DOMHighResTimeStamp Duration() const override { return mDuration; }
33 void GetDetail(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval);
35 size_t SizeOfIncludingThis(
36 mozilla::MallocSizeOf aMallocSizeOf) const override;
38 protected:
39 virtual ~PerformanceMeasure();
40 DOMHighResTimeStamp mStartTime;
41 DOMHighResTimeStamp mDuration;
43 private:
44 JS::Heap<JS::Value> mDetail;
47 } // namespace mozilla::dom
49 #endif /* mozilla_dom_performancemeasure_h___ */