2009-04-08 16:24:25 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-04-13 16:29:41 +00:00
|
|
|
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
|
2012-05-21 11:12:37 +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/. */
|
2008-09-12 21:30:37 +00:00
|
|
|
|
2010-06-01 12:38:00 +00:00
|
|
|
#ifndef MOZSTORAGESTATEMENTPARAMS_H
|
|
|
|
#define MOZSTORAGESTATEMENTPARAMS_H
|
2008-09-12 21:30:37 +00:00
|
|
|
|
2012-06-13 03:35:10 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-08-24 08:52:52 +00:00
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
#include "nsPIDOMWindow.h"
|
|
|
|
#include "nsWrapperCache.h"
|
2008-11-19 19:33:00 +00:00
|
|
|
|
2009-04-08 16:24:25 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace storage {
|
|
|
|
|
2017-08-24 08:52:52 +00:00
|
|
|
class Statement;
|
|
|
|
|
|
|
|
class StatementParams final : public nsISupports, public nsWrapperCache {
|
2008-09-12 21:30:37 +00:00
|
|
|
public:
|
2017-08-24 08:52:52 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StatementParams)
|
|
|
|
|
|
|
|
explicit StatementParams(nsPIDOMWindowInner* aWindow, Statement* aStatement);
|
|
|
|
|
|
|
|
void NamedGetter(JSContext* aCx, const nsAString& aName, bool& aFound,
|
|
|
|
JS::MutableHandle<JS::Value> aResult,
|
|
|
|
mozilla::ErrorResult& aRv);
|
|
|
|
|
|
|
|
void NamedSetter(JSContext* aCx, const nsAString& aName,
|
|
|
|
JS::Handle<JS::Value> aValue, mozilla::ErrorResult& aRv);
|
|
|
|
|
|
|
|
uint32_t Length() const { return mParamCount; }
|
|
|
|
|
|
|
|
void IndexedGetter(JSContext* aCx, uint32_t aIndex, bool& aFound,
|
|
|
|
JS::MutableHandle<JS::Value> aResult,
|
|
|
|
mozilla::ErrorResult& aRv);
|
|
|
|
|
|
|
|
void IndexedSetter(JSContext* aCx, uint32_t aIndex,
|
|
|
|
JS::Handle<JS::Value> aValue, mozilla::ErrorResult& aRv);
|
|
|
|
|
|
|
|
void GetSupportedNames(nsTArray<nsString>& aNames);
|
|
|
|
|
|
|
|
JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2008-09-12 21:30:37 +00:00
|
|
|
|
2017-08-24 08:52:52 +00:00
|
|
|
nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
|
2008-09-12 21:30:37 +00:00
|
|
|
|
2017-08-24 08:52:52 +00:00
|
|
|
private:
|
2014-06-23 22:40:03 +00:00
|
|
|
~StatementParams() {}
|
|
|
|
|
2017-08-24 08:52:52 +00:00
|
|
|
nsCOMPtr<nsPIDOMWindowInner> mWindow;
|
|
|
|
Statement* mStatement;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mParamCount;
|
2008-11-19 19:33:00 +00:00
|
|
|
|
2015-03-12 16:55:56 +00:00
|
|
|
friend class StatementParamsHolder;
|
2008-09-12 21:30:37 +00:00
|
|
|
};
|
|
|
|
|
2009-04-08 16:24:25 +00:00
|
|
|
} // namespace storage
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-06-01 12:38:00 +00:00
|
|
|
#endif /* MOZSTORAGESTATEMENTPARAMS_H */
|