From 871591481130ea739b4d709fd3ace94e89a9966d Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Mon, 21 Oct 2024 09:31:23 +0000 Subject: [PATCH] Bug 1904562 - Change ClientDirectoryLock to inherit from OriginDirectoryLock; r=dom-storage-reviewers,asuth Differential Revision: https://phabricator.services.mozilla.com/D214850 --- dom/quota/ClientDirectoryLock.h | 23 ++++++----------------- dom/quota/OriginDirectoryLock.h | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/dom/quota/ClientDirectoryLock.h b/dom/quota/ClientDirectoryLock.h index 3065efdbb2d8..7e66d8edfb9e 100644 --- a/dom/quota/ClientDirectoryLock.h +++ b/dom/quota/ClientDirectoryLock.h @@ -9,7 +9,7 @@ #include "nsStringFwd.h" #include "mozilla/dom/quota/Client.h" -#include "mozilla/dom/quota/DirectoryLockImpl.h" +#include "mozilla/dom/quota/OriginDirectoryLock.h" #include "mozilla/dom/quota/PersistenceType.h" template @@ -40,29 +40,18 @@ class UniversalDirectoryLock; // A directory lock specialized for a given client directory (inside an origin // directory). -class ClientDirectoryLock final : public DirectoryLockImpl { +class ClientDirectoryLock final : public OriginDirectoryLock { friend class QuotaManager; friend class UniversalDirectoryLock; public: - using DirectoryLockImpl::DirectoryLockImpl; + using OriginDirectoryLock::OriginDirectoryLock; - // XXX These getters shouldn't exist in the base class, but since some + // XXX This getter shouldn't exist in the root class, but since some // consumers don't use proper casting to ClientDirectoryLock yet, we keep - // them in the base class and have explicit forwarding here. + // it in the root class and have explicit forwarding here. - // 'Get' prefix is to avoid name collisions with the enum - PersistenceType GetPersistenceType() const { - return DirectoryLockImpl::GetPersistenceType(); - } - - quota::OriginMetadata OriginMetadata() const { - return DirectoryLockImpl::OriginMetadata(); - } - - const nsACString& Origin() const { return DirectoryLockImpl::Origin(); } - - Client::Type ClientType() const { return DirectoryLockImpl::ClientType(); } + Client::Type ClientType() const { return OriginDirectoryLock::ClientType(); } private: static RefPtr Create( diff --git a/dom/quota/OriginDirectoryLock.h b/dom/quota/OriginDirectoryLock.h index c479292025cd..e7f67f3670ed 100644 --- a/dom/quota/OriginDirectoryLock.h +++ b/dom/quota/OriginDirectoryLock.h @@ -27,7 +27,7 @@ struct OriginMetadata; class QuotaManager; // A directory lock specialized for a given origin directory. -class OriginDirectoryLock final : public DirectoryLockImpl { +class OriginDirectoryLock : public DirectoryLockImpl { friend class QuotaManager; public: