/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : * 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/. */
if (!args.thisv().isObject()) {
::JS_ReportErrorASCII(aCtx, "mozIStorageStatement::step() requires object"); returnfalse;
}
JS::Rooted<JSObject*> obj(aCtx, &args.thisv().toObject());
nsresult rv =
xpc->GetWrappedNativeOfJSObject(aCtx, obj, getter_AddRefs(wrapper)); if (NS_FAILED(rv)) {
::JS_ReportErrorASCII(
aCtx, "mozIStorageStatement::step() could not obtain native statement"); returnfalse;
}
#ifdef DEBUG
{
nsCOMPtr<mozIStorageStatement> isStatement(
do_QueryInterface(wrapper->Native()));
NS_ASSERTION(isStatement, "How is this not a statement?!");
} #endif
#ifdef DEBUG
int32_t state;
(void)aStatement->GetState(&state);
NS_ASSERTION(state == mozIStorageStatement::MOZ_STORAGE_STATEMENT_EXECUTING, "Invalid state to get the row object - all calls will fail!"); #endif
JS::Rooted<JSObject*> scope(aCtx, aScopeObj);
if (!aStatement->mStatementRowHolder) {
dom::GlobalObject global(aCtx, scope); if (global.Failed()) { return NS_ERROR_UNEXPECTED;
}
#ifdef DEBUG
int32_t state;
(void)aStatement->GetState(&state);
NS_ASSERTION(state == mozIStorageStatement::MOZ_STORAGE_STATEMENT_READY, "Invalid state to get the params object - all calls will fail!"); #endif
JS::Rooted<JSObject*> scope(aCtx, aScopeObj);
if (!aStatement->mStatementParamsHolder) {
dom::GlobalObject global(aCtx, scope); if (global.Failed()) { return NS_ERROR_UNEXPECTED;
}
#ifdef DEBUG
{
nsCOMPtr<mozIStorageStatement> isStatement(
do_QueryInterface(aWrapper->Native()));
NS_ASSERTION(isStatement, "How is this not a statement?!");
} #endif
StatementParamsHolder::~StatementParamsHolder() {
MOZ_ASSERT(NS_IsMainThread()); // We are considered dead at this point, so any wrappers for row or params // need to lose their reference to the statement.
mParams->mStatement = nullptr;
}
NS_IMPL_ISUPPORTS0(StatementRowHolder);
StatementRowHolder::~StatementRowHolder() {
MOZ_ASSERT(NS_IsMainThread()); // We are considered dead at this point, so any wrappers for row or params // need to lose their reference to the statement.
mRow->mStatement = nullptr;
}
} // namespace storage
} // namespace mozilla
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.