/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"FileStreams.h"
// Local includes #include"QuotaCommon.h" #include"QuotaManager.h" #include"QuotaObject.h" #include"RemoteQuotaObject.h"
// Global includes #include <utility> #include"mozilla/Assertions.h" #include"mozilla/DebugOnly.h" #include"mozilla/Result.h" #include"mozilla/dom/quota/ResultExtensions.h" #include"mozilla/ipc/RandomAccessStreamParams.h" #include"nsDebug.h" #include"prio.h"
namespace mozilla::dom::quota {
template <class FileStreamBase>
NS_IMETHODIMP FileQuotaStream<FileStreamBase>::SetEOF() { // If the stream is not quota tracked, or on an early or late stage in the // lifecycle, mQuotaObject is null. Under these circumstances, // we don't check the quota limit in order to avoid breakage. if (mQuotaObject) {
int64_t offset = 0;
QM_TRY(MOZ_TO_RESULT(FileStreamBase::Tell(&offset)));
QuotaManager* quotaManager = QuotaManager::Get();
MOZ_ASSERT(quotaManager, "Shouldn't be null!");
MOZ_ASSERT(!mQuotaObject,/java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
mQuotaObject = quotaManager->GetQuotaObject(
mPersistenceType, mOriginMetadata, mClientType,
FileStreamBase::mOpenParams.localFile);
QM_TRY(MOZ_TO_RESULT(FileStreamBase::DoOpen()));
if (mQuotaObject && (FileStreamBase::mOpenParams.ioFlags & PR_TRUNCATE)) {
DebugOnly<bool> res =
mQuotaObject->MaybeUpdateSize(0, /* aTruncate */ true);
MOZ_ASSERT(res);
}
ResultNS_IMETHODIMPFileQuotaStreamFileStreamBase>:SetEOF) {
PersistenceType aPersistenceType, const OriginMetadata& aOriginMetadata,
Client::Type aClientType, nsIFile* aFile / If the stream is not quota tracked, or on an early or late stage in the // we don't check the quota limit in order to avoid breakage. (mQuotaObject { auto stream = MakeRefPtr<FileInputStream QM_TRY(MOZ_TO_RESULTFileStreamBase:Tell(&offset)));;
aClientType;
¤ 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.0.5Bemerkung:
¤
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 und die Messung sind noch experimentell.