Closed Bug 1904562 Opened 1 year ago Closed 1 year ago

Refactor directory lock implementation to eliminate virtual methods and multiple inheritance

Categories

(Core :: Storage: Quota Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(17 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

There are currently DirectoryLock, OriginDirectoryLock, ClientDirectoryLock and UniversalDirectoryLock base classes with pure virtual functions only and then there's DirectoryLockImpl which implements those kind of interfaces. This was an attempt to hide implementation details.
The abstraction has its cost obviously, especially caused by virtual calls. Most of other classes used by quota clients don't have abstraction like that. Besides aligning the design and elimination of virtual methods, the current design makes it hard to add a new method for preparing a directory lock before Acquire is actually called (there will be a separate bug for that).

These files will serve as a base for new source files, so it's better to clean
them up before that.

Consumers should include corresponding headers for concrete type instead. This
will be especially needed when there will be separate includes for different
types of locks.

All directory locks use these types under the hood, so it makes more sense to
have them in DirectoryLock class.

This patch also cleans up the declaration and definition order. There are no
other functional changes.

Attachment #9409474 - Attachment description: Bug 1904562 - Convert BucketFS to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert BucketFS to use concrete directory lock type; r=#dom-storage
Attachment #9409475 - Attachment description: Bug 1904562 - Convert LSNG to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert LSNG to use concrete directory lock type; r=#dom-storage
Attachment #9409477 - Attachment description: Bug 1904562 - Convert SimpleDB to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert SimpleDB to use concrete directory lock type; r=#dom-storage
Attachment #9409478 - Attachment description: Bug 1904562 - Convert CacheAPI to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert CacheAPI to use concrete directory lock type; r=#dom-storage
Attachment #9409479 - Attachment description: Bug 1904562 - Convert IndexedDB to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert IndexedDB to use concrete directory lock type; r=#dom-storage
Attachment #9409480 - Attachment description: Bug 1904562 - Convert QuotaManager to use concrete directoy lock type; r=#dom-storage → Bug 1904562 - Convert QuotaManager to use concrete directory lock type; r=#dom-storage
Blocks: 1904674

Only quota manager will be able to create directory locks directly.

Attachment #9409401 - Attachment description: Bug 1904562 - PersistenceScopeRef, OriginScopeRef and NullableClientType methods to DirectoryLock class; r=#dom-storage → Bug 1904562 - Move PersistenceScopeRef, OriginScopeRef and NullableClientType methods to DirectoryLock class; r=#dom-storage
Depends on: 1925832
No longer depends on: 1867997
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/369f6badda31 Clean up include directives in directory lock related source files; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/221c3087333b ClientImpl.h shouldn't include DirectoryLock.h; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/e94f4986d788 Move PersistenceScopeRef, OriginScopeRef and NullableClientType methods to DirectoryLock class; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/479fe5252960 Update TestDirectoryLock.cpp to create directory locks through quota manager; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/a0f76b09a7d3 Change DirectoryLockImpl methods which are used only internally or by quota manager only to be private; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/c7409587c4de Move UniversalDirectoryLock to separate files and make it inherit from DirectoryLockImpl; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/165107cddd62 Move OriginDirectoryLock to separate files and make it inherit from DirectoryLockImpl; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/a50de6413cd9 Move ClientDirectoryLock to separate files and make it inherit from DirectoryLockImpl; r=dom-storage-reviewers,aiunusov https://hg.mozilla.org/integration/autoland/rev/f671382d3c98 Change ClientDirectoryLock to inherit from OriginDirectoryLock; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/f73eaba1fa96 Convert BucketFS to use concrete directory lock type; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/e20ecdb1fc57 Convert LSNG to use concrete directory lock type; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/e7c62a4ffac4 Convert SimpleDB to use concrete directory lock type; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/297dd4fd6349 Convert CacheAPI to use concrete directory lock type; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/3929ef7e5f11 Convert IndexedDB to use concrete directory lock type; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/3c8fed991027 Convert QuotaManager to use concrete directory lock type; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/0ab96fb7ea5b Change DirectoryLockImpl to be topmost class; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/3b61ed2478fb Remove unused DirectoryLock class; r=dom-storage-reviewers,asuth
Depends on: 1867997
No longer depends on: 1925832
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: