/* -*- 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. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
class BlobImpl; class ContentParent; class File; class GetFilesHelperParent; class OwningFileOrDirectory; class Promise;
class GetFilesCallback { public:
NS_INLINE_DECL_REFCOUNTING(GetFilesCallback);
// This is called once per directory scan and is passed an array of all // of the files found. virtualvoid Callback(nsresult aStatus, const FallibleTArray<RefPtr<BlobImpl>>& aBlobImpls) = 0;
// We populate this array in the I/O thread with the BlobImpl.
FallibleTArray<RefPtr<BlobImpl>> mTargetBlobImplArray;
};
// Retrieving the list of files can be very time/IO consuming. We use this // helper class to do it just once. class GetFilesHelper : public Runnable, public GetFilesHelperBase { friendclass GetFilesHelperParent;
// This variable is protected by mutex. bool mCanceled;
};
class GetFilesHelperChild final : public GetFilesHelper { public: explicit GetFilesHelperChild(bool aRecursiveFlag)
: GetFilesHelper(aRecursiveFlag), mPendingOperation(false) {}
virtualvoid Work(ErrorResult& aRv) override;
virtualvoid Cancel() override;
bool AppendBlobImpl(BlobImpl* aBlobImpl);
void Finished(nsresult aResult);
private:
nsID mUUID; bool mPendingOperation;
};
class GetFilesHelperParentCallback;
class GetFilesHelperParent final : public GetFilesHelper { friendclass GetFilesHelperParentCallback;
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.