2009-04-08 20:24:25 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-04-13 20:29:41 +04:00
|
|
|
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
|
2012-05-21 15:12:37 +04: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-13 01:30:37 +04:00
|
|
|
|
2010-06-01 16:38:00 +04:00
|
|
|
#ifndef MOZSTORAGESTATEMENTPARAMS_H
|
|
|
|
#define MOZSTORAGESTATEMENTPARAMS_H
|
2008-09-13 01:30:37 +04:00
|
|
|
|
2012-06-13 07:35:10 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-08-24 11:52:52 +03:00
|
|
|
#include "nsPIDOMWindow.h"
|
|
|
|
#include "nsWrapperCache.h"
|
2008-11-19 22:33:00 +03:00
|
|
|
|
2009-04-08 20:24:25 +04:00
|
|
|
namespace mozilla {
|
2020-11-23 19:12:02 +03:00
|
|
|
class ErrorResult;
|
|
|
|
|
2009-04-08 20:24:25 +04:00
|
|
|
namespace storage {
|
|
|
|
|
2017-08-24 11:52:52 +03:00
|
|
|
class Statement;
|
|
|
|
|
|
|
|
class StatementParams final : public nsISupports, public nsWrapperCache {
|
2008-09-13 01:30:37 +04:00
|
|
|
public:
|
2017-08-24 11:52:52 +03: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-13 01:30:37 +04:00
|
|
|
|
2017-08-24 11:52:52 +03:00
|
|
|
nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
|
2008-09-13 01:30:37 +04:00
|
|
|
|
2017-08-24 11:52:52 +03:00
|
|
|
private:
|
2014-06-24 02:40:03 +04:00
|
|
|
~StatementParams() {}
|
|
|
|
|
2017-08-24 11:52:52 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindowInner> mWindow;
|
|
|
|
Statement* mStatement;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mParamCount;
|
2008-11-19 22:33:00 +03:00
|
|
|
|
2015-03-12 19:55:56 +03:00
|
|
|
friend class StatementParamsHolder;
|
2008-09-13 01:30:37 +04:00
|
|
|
};
|
|
|
|
|
2009-04-08 20:24:25 +04:00
|
|
|
} // namespace storage
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-06-01 16:38:00 +04:00
|
|
|
#endif /* MOZSTORAGESTATEMENTPARAMS_H */
|