/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */
// We only support nsIAsyncInputStream when we are in non-blocking mode.
NS_INTERFACE_MAP_BEGIN(nsBaseContentStream)
NS_INTERFACE_MAP_ENTRY(nsIInputStream)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAsyncInputStream, mNonBlocking)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
NS_INTERFACE_MAP_END
NS_IMETHODIMP
nsBaseContentStream::AsyncWait(nsIInputStreamCallback* callback, uint32_t flags,
uint32_t requestedCount,
nsIEventTarget* target) { // Our _only_ consumer is nsInputStreamPump, so we simplify things here by // making assumptions about how we will be called.
NS_ASSERTION(target, "unexpected parameter");
NS_ASSERTION(flags == 0, "unexpected parameter");
NS_ASSERTION(requestedCount == 0, "unexpected parameter");
#ifdef DEBUG bool correctThread;
target->IsOnCurrentThread(&correctThread);
NS_ASSERTION(correctThread, "event target must be on the current thread"); #endif
mCallback = callback;
mCallbackTarget = target;
if (!mCallback) return NS_OK;
// If we're already closed, then dispatch this callback immediately. if (IsClosed()) {
DispatchCallback(); return NS_OK;
}
OnCallbackPending(); return NS_OK;
}
¤ Dauer der Verarbeitung: 0.15 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.