mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1903985
- Add some information about pending ClearRequestBase operations to quota manager shutdown crash annotation; r=dom-storage-reviewers,jstutte
For now, we only report how many directory iterations have been done. Differential Revision: https://phabricator.services.mozilla.com/D214521
This commit is contained in:
parent
25391ea7c1
commit
1c67110e4b
@ -2268,11 +2268,17 @@ void QuotaManager::Shutdown() {
|
||||
if (gNormalOriginOps) {
|
||||
annotation.AppendPrintf("QM: %zu normal origin ops pending\n",
|
||||
gNormalOriginOps->Length());
|
||||
#ifdef QM_COLLECTING_OPERATION_TELEMETRY
|
||||
|
||||
for (const auto& op : *gNormalOriginOps) {
|
||||
#ifdef QM_COLLECTING_OPERATION_TELEMETRY
|
||||
annotation.AppendPrintf("Op: %s pending\n", op->Name());
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCString data;
|
||||
op->Stringify(data);
|
||||
|
||||
annotation.AppendPrintf("Op details:\n%s\n", data.get());
|
||||
}
|
||||
}
|
||||
{
|
||||
MutexAutoLock lock(quotaManager->mQuotaMutex);
|
||||
|
@ -13,13 +13,15 @@
|
||||
#include "mozilla/dom/quota/Config.h"
|
||||
#include "mozilla/dom/quota/ForwardDecls.h"
|
||||
#include "mozilla/dom/quota/QuotaCommon.h"
|
||||
#include "mozilla/dom/quota/StringifyUtils.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
namespace mozilla::dom::quota {
|
||||
|
||||
class QuotaManager;
|
||||
|
||||
class OriginOperationBase : public BackgroundThreadObject {
|
||||
class OriginOperationBase : public BackgroundThreadObject,
|
||||
public Stringifyable {
|
||||
protected:
|
||||
const NotNull<RefPtr<QuotaManager>> mQuotaManager;
|
||||
nsresult mResultCode;
|
||||
@ -70,6 +72,9 @@ class OriginOperationBase : public BackgroundThreadObject {
|
||||
virtual nsresult DoDirectoryWork(QuotaManager& aQuotaManager) = 0;
|
||||
|
||||
virtual void UnblockOpen() = 0;
|
||||
|
||||
private:
|
||||
void DoStringify(nsACString& aData) override {}
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom::quota
|
||||
|
@ -506,10 +506,13 @@ class ClearStorageOp final
|
||||
|
||||
class ClearRequestBase
|
||||
: public OpenStorageDirectoryHelper<ResolvableNormalOriginOp<bool>> {
|
||||
Atomic<uint64_t> mIterations;
|
||||
|
||||
protected:
|
||||
ClearRequestBase(MovingNotNull<RefPtr<QuotaManager>> aQuotaManager,
|
||||
const char* aName)
|
||||
: OpenStorageDirectoryHelper(std::move(aQuotaManager), aName) {
|
||||
: OpenStorageDirectoryHelper(std::move(aQuotaManager), aName),
|
||||
mIterations(0) {
|
||||
AssertIsOnOwningThread();
|
||||
}
|
||||
|
||||
@ -529,6 +532,17 @@ class ClearRequestBase
|
||||
const OriginScope& aOriginScope,
|
||||
const Nullable<Client::Type>& aClientType,
|
||||
const FileCollector& aFileCollector);
|
||||
|
||||
void DoStringify(nsACString& aData) override {
|
||||
aData.Append("ClearRequestBase "_ns +
|
||||
//
|
||||
kStringifyStartInstance +
|
||||
//
|
||||
"Iterations:"_ns +
|
||||
IntToCString(static_cast<uint64_t>(mIterations)) +
|
||||
//
|
||||
kStringifyEndInstance);
|
||||
}
|
||||
};
|
||||
|
||||
class ClearOriginOp final : public ClearRequestBase {
|
||||
@ -1975,7 +1989,8 @@ void ClearRequestBase::DeleteFilesInternal(
|
||||
QM_TRY(
|
||||
aFileCollector([&aClientType, &originScope = aOriginScope,
|
||||
aPersistenceType, &aQuotaManager,
|
||||
&directoriesForRemovalRetry](nsCOMPtr<nsIFile>&& file)
|
||||
&directoriesForRemovalRetry,
|
||||
this](nsCOMPtr<nsIFile>&& file)
|
||||
-> mozilla::Result<Ok, nsresult> {
|
||||
QM_TRY_INSPECT(const auto& dirEntryKind, GetDirEntryKind(*file));
|
||||
|
||||
@ -2078,6 +2093,8 @@ void ClearRequestBase::DeleteFilesInternal(
|
||||
break;
|
||||
}
|
||||
|
||||
mIterations++;
|
||||
|
||||
return Ok{};
|
||||
}),
|
||||
QM_VOID);
|
||||
|
Loading…
Reference in New Issue
Block a user