In order to support the update to move args when invoking callbacks we:
- Convert anything that was using WrapRunnable with `nsAutoPtr` to `UniquePtr`
- Convert anything that was using a non-const ref as a param to either a
const ref or a by-val copy
Addtionally we convert the remaining `nsAutoPtr` usage to `UniquePtr`.
Differential Revision: https://phabricator.services.mozilla.com/D59961
--HG--
extra : moz-landing-system : lando
In order to support the update to move args when invoking callbacks we:
- Convert anything that was using WrapRunnable with `nsAutoPtr` to `UniquePtr`
- Convert anything that was using a non-const ref as a param to either a
const ref or a by-val copy
Addtionally we convert the remaining `nsAutoPtr` usage to `UniquePtr`.
Differential Revision: https://phabricator.services.mozilla.com/D59961
--HG--
extra : moz-landing-system : lando
UniquePtr is more standard than ScopedDeletePtr; using standard
constructs whenever possible is preferable.
This patch merits a couple explanations:
- Where it made sense, I tried to convert:
T* foo() {
UniquePtr<T> x = ...;
...
return x.release();
}
into:
UniquePtr<T> foo()
with corresponding changes inside |foo|'s body.
- The attentive reader will note that:
auto x = MakeUnique<T>(...);
is used sometimes and:
UniquePtr<T> x(new T(...));
is used sometimes. I would prefer to use the former, but was stymied
in several places due to protected constructors. (MakeUnique doesn't
have access to those protected constructors, natch.)
UniquePtr is more standard than ScopedDeletePtr; using standard
constructs whenever possible is preferable.
This patch merits a couple explanations:
- Where it made sense, I tried to convert:
T* foo() {
UniquePtr<T> x = ...;
...
return x.release();
}
into:
UniquePtr<T> foo()
with corresponding changes inside |foo|'s body.
- The attentive reader will note that:
auto x = MakeUnique<T>(...);
is used sometimes and:
UniquePtr<T> x(new T(...));
is used sometimes. I would prefer to use the former, but was stymied
in several places due to protected constructors. (MakeUnique doesn't
have access to those protected constructors, natch.)