1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZSTORAGESTATEMENTJSHELPER_H
8 #define MOZSTORAGESTATEMENTJSHELPER_H
10 #include "nsIXPCScriptable.h"
11 #include "nsIXPConnect.h"
18 class StatementParams
;
21 class StatementJSHelper
: public nsIXPCScriptable
25 NS_DECL_NSIXPCSCRIPTABLE
28 nsresult
getRow(Statement
*, JSContext
*, JSObject
*, JS::Value
*);
29 nsresult
getParams(Statement
*, JSContext
*, JSObject
*, JS::Value
*);
33 * Wrappers used to clean up the references JS helpers hold to the statement.
34 * For cycle-avoidance reasons they do not hold reference-counted references,
35 * so it is important we do this.
38 class StatementParamsHolder final
: public nsISupports
{
42 explicit StatementParamsHolder(StatementParams
* aParams
)
47 StatementParams
* Get() const {
53 virtual ~StatementParamsHolder();
55 RefPtr
<StatementParams
> mParams
;
58 class StatementRowHolder final
: public nsISupports
{
62 explicit StatementRowHolder(StatementRow
* aRow
)
67 StatementRow
* Get() const {
73 virtual ~StatementRowHolder();
75 RefPtr
<StatementRow
> mRow
;
78 } // namespace storage
79 } // namespace mozilla
81 #endif // MOZSTORAGESTATEMENTJSHELPER_H