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.
Differential Revision: https://phabricator.services.mozilla.com/D196513
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`.)
Differential Revision: https://phabricator.services.mozilla.com/D196365
As we no longer support Windows versions without `RoGetAgileReference`,
we can drop the old global-interface-table manipulation version of this
code.
We temporarily retain the dynamic linking of `RoGetAgileReference` on
MinGW builds, as MinGW doesn't know how to link it yet.
Differential Revision: https://phabricator.services.mozilla.com/D196364
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.
Differential Revision: https://phabricator.services.mozilla.com/D196513
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`.)
Differential Revision: https://phabricator.services.mozilla.com/D196365
As we no longer support Windows versions without `RoGetAgileReference`,
we can drop the old global-interface-table manipulation version of this
code.
Differential Revision: https://phabricator.services.mozilla.com/D196364
Modernize and clean up ApartmentRegion.h:
- Apply all of clang-tidy's suggestions.
- Rename the template parameter `T` (which, as a template parameter, is
typically reserved for types) to `AptType`.
- When using `ApartmentRegionT`, include `COINIT_DISABLE_OLE1DDE` by
default. (Out of an abundance of caution, do not do so for
`ApartmentRegion`.)
Differential Revision: https://phabricator.services.mozilla.com/D194302
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.
I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).
Differential Revision: https://phabricator.services.mozilla.com/D190450
This was only ever used by the old accessibility architecture based on content process COM proxies, which is now being removed.
Differential Revision: https://phabricator.services.mozilla.com/D177964
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.
Differential Revision: https://phabricator.services.mozilla.com/D177963
This was only ever used by the old accessibility architecture based on content process COM proxies, which is now being removed.
Differential Revision: https://phabricator.services.mozilla.com/D177964
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.
Differential Revision: https://phabricator.services.mozilla.com/D177963
We aren't likely to try to make these changes any time soon, so cleaning out
these unnecessary methods which just return `this` will simplify things.
I was unable to find any calls to the `.eventTarget` getter in JS, which makes
sense, as the nsIThread type is only really used in JS as a wrapper around the
main thread in older code. Because of that, it has been removed as well.
Differential Revision: https://phabricator.services.mozilla.com/D166605
We aren't likely to try to make these changes any time soon, so cleaning out
these unnecessary methods which just return `this` will simplify things.
I was unable to find any calls to the `.eventTarget` getter in JS, which makes
sense, as the nsIThread type is only really used in JS as a wrapper around the
main thread in older code. Because of that, it has been removed as well.
Differential Revision: https://phabricator.services.mozilla.com/D166605
It is possible to specify full names for capabilities when using the clang
thread-safety analysis which will be used in error messages. We should use that
form of the attribute rather than the legacy lockable attribute.
Differential Revision: https://phabricator.services.mozilla.com/D160531
Most users of JSONWriter want to fill a string, so instead of having all these
similar implementations, we now have central reusable implementations:
- JSONStringWriteFunc contains a string and writes to it.
- JSONStringRefWriteFunc references a string and writes to it. This is most
useful when the string already exists somewhere, or needs to be returned from
a function (so we avoid another conversion when returning).
Differential Revision: https://phabricator.services.mozilla.com/D154618
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.
(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)
Differential Revision: https://phabricator.services.mozilla.com/D154616
Most users of JSONWriter want to fill a string, so instead of having all these
similar implementations, we now have central reusable implementations:
- JSONStringWriteFunc contains a string and writes to it.
- JSONStringRefWriteFunc references a string and writes to it. This is most
useful when the string already exists somewhere, or needs to be returned from
a function (so we avoid another conversion when returning).
Depends on D154617
Differential Revision: https://phabricator.services.mozilla.com/D154618
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.
(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)
Differential Revision: https://phabricator.services.mozilla.com/D154616