Modernize mozilla::mscom::AgileReference
Categories
(Core :: IPC: MSCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: rkraesig, Assigned: rkraesig)
References
(Regressed 1 open bug)
Details
Attachments
(5 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1869053 - [2/5] eliminate all implicit conversions between RefPtr and AgileReference r?handyman!
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 |
AgileReference
has an alternate implementation via the global interface table that is no longer needed, since we no longer support versions of Windows prior to the introduction of RoGetAgileReference
.
Assignee | ||
Comment 1•9 months ago
|
||
As we no longer support Windows versions without RoGetAgileReference
,
we can drop the old global-interface-table manipulation version of this
code.
Updated•9 months ago
|
Assignee | ||
Comment 2•9 months ago
|
||
Remove all of the code in RefPtr
and AgileReference
that allowed
for implicitly converting between the two in via constructors or the
assignment operator.
Replace these with a slightly-less-convenient-but-substantially-more-
explicit Resolve
function family.
(This also eliminates the dependency that class RefPtr
had on
class AgileReference
.)
Depends on D196364
Assignee | ||
Comment 3•9 months ago
|
||
The documentation for AgileReference previously suggested instantiating
it within a UniquePtr. However, this isn't necessary or helpful in most
contexts.
Streamline the one place where this was done.
Depends on D196365
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 4•9 months ago
•
|
||
This function has not been used since its introduction in 2019.
Depends on D196366
Assignee | ||
Comment 5•9 months ago
|
||
Lift aIid
to compile-time, as a template parameter InterfaceT
. This
simplifies the common case for using Resolve()
, where the desired and
supplied interfaces are the same. (For the as-yet-unattested case where
they're not, retain the old functionality by means of a small family of
ResolveAs()
functions.)
Additionally, to eliminate a swath of custom logic and magic-number
choices surrounding mHResult
, eliminate mHResult
itself as well.
Instead, since its value was derived from the creation of the underlying
IAgileReference
, any callers that might care can acquire it as an
additional return value from a named-constructor function.
These collectively trim AgileReference
's footprint down to a single
RefPtr
, with all its special member functions having only default
implementations.
Depends on D196512
Assignee | ||
Comment 6•9 months ago
|
||
Rather than refactor it to work with a templatized AgileInterface, D196512 removes EnsureMTA::CreateInstance
, which has never been used.
I don't think it generally should be, at least with the interface it has. If the caller can await on a Promise for the AgileInterface's creation, it can probably also await on a Promise for calling methods on the object in question. Moreover, invoking a method on an MTA-sourced AgileInterface is approximately equivalent to calling EnsureMTA::EnsureMTA()
directly, blocking as we do so; most callers would probably be better off awaiting on such a work promise, rather than suffering mini-stalls after the initial await.
(This explanation extracted and paraphrased from the original commit summary for D196512.)
Comment 8•9 months ago
|
||
Backed out for causing build bustages
Backout link: https://hg.mozilla.org/integration/autoland/rev/c12f6936509f05b3caad77d4cb4b783a38761897
Assignee | ||
Comment 9•9 months ago
|
||
Failure to link on MinGW, as it doesn't know about RoGetAgileReference
.
Per conversation on Matrix, that is fixable — but, to unblock this patch, we'll just link it dynamically on MinGW builds for now.
Comment 10•9 months ago
|
||
Comment 11•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2f4b4c654ebb
https://hg.mozilla.org/mozilla-central/rev/4d3f0b4a6107
https://hg.mozilla.org/mozilla-central/rev/93c92f80d81f
https://hg.mozilla.org/mozilla-central/rev/9346eb3ea0e4
https://hg.mozilla.org/mozilla-central/rev/19b846ec490c
Description
•