Quelle mozStorageAsyncStatementJSHelper.cpp
Sprache: C
/* -*- 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/. */
#ifdef DEBUG
int32_t state;
(void)aStatement->GetState(&state);
NS_ASSERTION(state == mozIStorageAsyncStatement::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;
}
// Cast to async via mozI* since direct from nsISupports is ambiguous.
JS::Rooted<JSObject*> scope(aCtx, aScopeObj);
JS::Rooted<JS::PropertyKey> id(aCtx, aId);
mozIStorageAsyncStatement* iAsyncStmt = static_cast<mozIStorageAsyncStatement*>(aWrapper->Native());
AsyncStatement* stmt = static_cast<AsyncStatement*>(iAsyncStmt);
#ifdef DEBUG
{
nsISupports* supp = aWrapper->Native();
nsCOMPtr<mozIStorageAsyncStatement> isStatement(do_QueryInterface(supp));
NS_ASSERTION(isStatement, "How is this not an async statement?!");
} #endif
AsyncStatementParamsHolder::~AsyncStatementParamsHolder() {
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;
}
} // namespace storage
} // namespace mozilla
¤ Dauer der Verarbeitung: 0.2 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.