Bug 1443265 - make already_AddRefed a MOZ_TEMPORARY_CLASS; r=mystor
authorNathan Froyd <froydnj@mozilla.com>
Mon, 05 Mar 2018 16:12:41 -0500
changeset 461686 b31288fb959a2699a94376baeb8436055b79289a
parent 461685 d45bbc02ad0ddab649f1c7387c6942a1a19381a6
child 461687 4476e8f51fa6fb2151ce5997c3516980c22ca0e1
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1443265
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1443265 - make already_AddRefed a MOZ_TEMPORARY_CLASS; r=mystor
mfbt/AlreadyAddRefed.h
--- a/mfbt/AlreadyAddRefed.h
+++ b/mfbt/AlreadyAddRefed.h
@@ -32,17 +32,17 @@ struct unused_t;
  * * Ensure a consumer takes ownership of a reference
  * * Pass ownership without calling AddRef/Release (sometimes required in
  *   off-main-thread code)
  * * The ref pointer type you're using doesn't support move construction
  *
  * Otherwise, use Move(RefPtr/nsCOMPtr/etc).
  */
 template<class T>
-struct MOZ_MUST_USE_TYPE MOZ_NON_AUTOABLE already_AddRefed
+struct MOZ_TEMPORARY_CLASS MOZ_MUST_USE_TYPE MOZ_NON_AUTOABLE already_AddRefed
 {
   /*
    * We want to allow returning nullptr from functions returning
    * already_AddRefed<T>, for simplicity.  But we also don't want to allow
    * returning raw T*, instead preferring creation of already_AddRefed<T> from
    * a reference counting smart pointer.
    *
    * We address the latter requirement by making the (T*) constructor explicit.