2015-05-03 19:32:37 +00: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 05:46:23 +00: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 16:28:04 +00:00
|
|
|
class PerformanceMeasure final : public PerformanceEntry
|
2015-02-04 05:46:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-05-25 16:53:07 +00:00
|
|
|
PerformanceMeasure(nsISupports* aParent,
|
2015-02-04 05:46:23 +00:00
|
|
|
const nsAString& aName,
|
|
|
|
DOMHighResTimeStamp aStartTime,
|
|
|
|
DOMHighResTimeStamp aEndTime);
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2015-02-04 05:46:23 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual DOMHighResTimeStamp StartTime() const override
|
2015-02-04 05:46:23 +00:00
|
|
|
{
|
|
|
|
return mStartTime;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual DOMHighResTimeStamp Duration() const override
|
2015-02-04 05:46:23 +00:00
|
|
|
{
|
|
|
|
return mDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~PerformanceMeasure();
|
|
|
|
DOMHighResTimeStamp mStartTime;
|
|
|
|
DOMHighResTimeStamp mDuration;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_performancemeasure_h___ */
|