Line data Source code
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_performancemeasure_h___
8 : #define mozilla_dom_performancemeasure_h___
9 :
10 : #include "mozilla/dom/PerformanceEntry.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : // http://www.w3.org/TR/user-timing/#performancemeasure
16 : class PerformanceMeasure final : public PerformanceEntry
17 : {
18 : public:
19 : PerformanceMeasure(nsISupports* aParent,
20 : const nsAString& aName,
21 : DOMHighResTimeStamp aStartTime,
22 : DOMHighResTimeStamp aEndTime);
23 :
24 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
25 :
26 0 : virtual DOMHighResTimeStamp StartTime() const override
27 : {
28 0 : return mStartTime;
29 : }
30 :
31 0 : virtual DOMHighResTimeStamp Duration() const override
32 : {
33 0 : return mDuration;
34 : }
35 :
36 : protected:
37 : virtual ~PerformanceMeasure();
38 : DOMHighResTimeStamp mStartTime;
39 : DOMHighResTimeStamp mDuration;
40 : };
41 :
42 : } // namespace dom
43 : } // namespace mozilla
44 :
45 : #endif /* mozilla_dom_performancemeasure_h___ */
|