Open Bug 1904562 Opened 8 days ago Updated 7 days ago

Refactor directory lock implementation to eliminate virtual methods and multiple inheritance

Categories

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

task

Tracking

()

ASSIGNED

People

(Reporter: janv, Assigned: janv)

References

(Depends on 1 open bug, Blocks 2 open bugs)

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: