2015-08-18 01:13:20 +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: */
|
|
|
|
/* 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_PerformanceObserverEntryList_h__
|
|
|
|
#define mozilla_dom_PerformanceObserverEntryList_h__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsWrapperCache.h"
|
2018-02-12 23:02:22 +03:00
|
|
|
#include "mozilla/dom/DOMPrefs.h"
|
2015-08-18 01:13:20 +03:00
|
|
|
#include "mozilla/dom/PerformanceEntryBinding.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
struct PerformanceEntryFilterOptions;
|
|
|
|
class PerformanceEntry;
|
|
|
|
template <typename T>
|
|
|
|
class Optional;
|
|
|
|
|
|
|
|
class PerformanceObserverEntryList final : public nsISupports,
|
|
|
|
public nsWrapperCache {
|
|
|
|
~PerformanceObserverEntryList();
|
|
|
|
|
|
|
|
public:
|
2015-09-03 00:41:00 +03:00
|
|
|
PerformanceObserverEntryList(nsISupports* aOwner,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<PerformanceEntry>>& aEntries)
|
2015-09-03 00:41:00 +03:00
|
|
|
: mOwner(aOwner), mEntries(aEntries) {}
|
2015-08-18 01:13:20 +03:00
|
|
|
|
|
|
|
nsISupports* GetParentObject() const { return mOwner; }
|
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceObserverEntryList)
|
|
|
|
|
|
|
|
void GetEntries(const PerformanceEntryFilterOptions& aFilter,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<PerformanceEntry>>& aRetval);
|
2015-08-18 01:13:20 +03:00
|
|
|
void GetEntriesByType(const nsAString& aEntryType,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<PerformanceEntry>>& aRetval);
|
2015-08-18 01:13:20 +03:00
|
|
|
void GetEntriesByName(const nsAString& aName,
|
|
|
|
const Optional<nsAString>& aEntryType,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<PerformanceEntry>>& aRetval);
|
2015-08-18 01:13:20 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsISupports> mOwner;
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<PerformanceEntry>> mEntries;
|
2015-08-18 01:13:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|