2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-02-04 08:46:23 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_performancemeasure_h___
|
|
|
|
#define mozilla_dom_performancemeasure_h___
|
|
|
|
|
|
|
|
#include "mozilla/dom/PerformanceEntry.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/user-timing/#performancemeasure
|
2015-03-21 19:28:04 +03:00
|
|
|
class PerformanceMeasure final : public PerformanceEntry
|
2015-02-04 08:46:23 +03:00
|
|
|
{
|
|
|
|
public:
|
2015-05-25 19:53:07 +03:00
|
|
|
PerformanceMeasure(nsISupports* aParent,
|
2015-02-04 08:46:23 +03:00
|
|
|
const nsAString& aName,
|
|
|
|
DOMHighResTimeStamp aStartTime,
|
|
|
|
DOMHighResTimeStamp aEndTime);
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2015-02-04 08:46:23 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual DOMHighResTimeStamp StartTime() const override
|
2015-02-04 08:46:23 +03:00
|
|
|
{
|
|
|
|
return mStartTime;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual DOMHighResTimeStamp Duration() const override
|
2015-02-04 08:46:23 +03:00
|
|
|
{
|
|
|
|
return mDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~PerformanceMeasure();
|
|
|
|
DOMHighResTimeStamp mStartTime;
|
|
|
|
DOMHighResTimeStamp mDuration;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_performancemeasure_h___ */
|