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: */
|
2015-10-15 20:06:44 +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_TestInterfaceIterableSingle_h
|
|
|
|
#define mozilla_dom_TestInterfaceIterableSingle_h
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2017-10-26 13:12:44 +03:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "nsTArray.h"
|
2015-10-15 20:06:44 +03:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
class nsPIDOMWindowInner;
|
2015-10-15 20:06:44 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class ErrorResult;
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class GlobalObject;
|
|
|
|
|
|
|
|
// Implementation of test binding for webidl iterable interfaces, using
|
|
|
|
// primitives for value type
|
|
|
|
class TestInterfaceIterableSingle final : public nsISupports,
|
|
|
|
public nsWrapperCache {
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableSingle)
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
explicit TestInterfaceIterableSingle(nsPIDOMWindowInner* aParent);
|
|
|
|
nsPIDOMWindowInner* GetParentObject() const;
|
2015-10-15 20:06:44 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
static already_AddRefed<TestInterfaceIterableSingle> Constructor(
|
|
|
|
const GlobalObject& aGlobal, ErrorResult& rv);
|
|
|
|
|
2016-02-18 06:57:57 +03:00
|
|
|
uint32_t Length() const;
|
|
|
|
int32_t IndexedGetter(uint32_t aIndex, bool& aFound) const;
|
|
|
|
|
2015-10-15 20:06:44 +03:00
|
|
|
private:
|
|
|
|
virtual ~TestInterfaceIterableSingle() {}
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindowInner> mParent;
|
2016-02-18 06:57:57 +03:00
|
|
|
nsTArray<int32_t> mValues;
|
2015-10-15 20:06:44 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_TestInterfaceIterableSingle_h
|