2017-10-27 01:08:41 +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: */
|
2017-06-16 10:17:09 +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_timeoutbudgetmanager_h
|
|
|
|
#define mozilla_dom_timeoutbudgetmanager_h
|
|
|
|
|
|
|
|
#include "mozilla/TimeStamp.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2017-06-19 11:11:47 +03:00
|
|
|
class Timeout;
|
|
|
|
|
2017-06-16 10:17:09 +03:00
|
|
|
class TimeoutBudgetManager {
|
|
|
|
public:
|
|
|
|
static TimeoutBudgetManager& Get();
|
|
|
|
void StartRecording(const TimeStamp& aNow);
|
|
|
|
void StopRecording();
|
2017-06-14 18:47:38 +03:00
|
|
|
TimeDuration RecordExecution(const TimeStamp& aNow, const Timeout* aTimeout);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-06-16 10:17:09 +03:00
|
|
|
private:
|
2018-10-12 21:01:19 +03:00
|
|
|
TimeoutBudgetManager() = default;
|
|
|
|
|
2017-06-16 10:17:09 +03:00
|
|
|
TimeStamp mStart;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_timeoutbudgetmanager_h
|