Closed
Bug 1473771
Opened 6 years ago
Closed 6 years ago
make LinkedList work better when its element type inherits from multiple LinkedListElement<T>s
Categories
(Core :: MFBT, enhancement)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(2 files)
Currently mozilla::dom::MediaQueryList inherits from both LinkedListElement<DOMEventTargetHelper> and LinkedListElement<MediaQueryList>. This causes some ambiguous name lookups from some LinkedList member functions. We can make them work with some static_cast<>s.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•6 years ago
|
||
For the Iterator patch, I was considering whether to leave just a single type parameter on Iterator, and to derive whether we use a const or non-const LinkedListElement<> pointer when static_cast<>ing. The long std::conditional<> stuff looked a bit ugly though so it was simpler just to pass in the right type to use.
Comment 4•6 years ago
|
||
mozreview-review |
Comment on attachment 8990166 [details] Bug 1473771 - Part 2: Make LinkedList::Iterator work when element type inherits from multiple LinkedListElement<T>s. https://reviewboard.mozilla.org/r/255184/#review262346 ::: mfbt/LinkedList.h:436 (Diff revision 1) > const Iterator& operator++() { > - mCurrent = mCurrent->getNext(); > + mCurrent = static_cast<Element>(mCurrent)->getNext(); > return *this; > } > > - bool operator!=(const Iterator<Type>& aOther) const { > + bool operator!=(const Iterator<Type, Element>& aOther) const { Just use `const Iterator& aOther` -- the type parameters are assumed if you don't provide them, here.
Attachment #8990166 -
Flags: review?(jwalden+bmo) → review+
Comment 5•6 years ago
|
||
mozreview-review |
Comment on attachment 8990165 [details] Bug 1473771 - Part 1: Make LinkedList<T>::sizeOfExcludingThis work when element type inherits from multiple LinkedListElement<T>s. https://reviewboard.mozilla.org/r/255182/#review262340 I'm super-dubious about the desirability of multiply inheriting LinkedListElement, but this isn't really precisely *extra* code to deal with that, so. Bleh.
Attachment #8990165 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 6•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=13f8a986895792b4489803c85c20474ae88a6a09
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Pushed by cam@mcc.id.au: https://hg.mozilla.org/integration/autoland/rev/56cf99e809bd Part 1: Make LinkedList<T>::sizeOfExcludingThis work when element type inherits from multiple LinkedListElement<T>s. r=Waldo https://hg.mozilla.org/integration/autoland/rev/f05677e4a0f7 Part 2: Make LinkedList::Iterator work when element type inherits from multiple LinkedListElement<T>s. r=Waldo
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/56cf99e809bd https://hg.mozilla.org/mozilla-central/rev/f05677e4a0f7
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•