Bug 1434689 - Part 4: Annotate IgnoreErrors as MOZ_TEMPORARY_CLASS. r=bz
authorEric Rahm <erahm@mozilla.com>
Fri, 02 Feb 2018 13:21:51 -0800
changeset 402268 38fdcb96bb9258fdd963a063273e36ab9da6e1fc
parent 402267 11f8f004395cf383fdcead9f5faac52634541b2a
child 402293 ca1687eb7bd8e7bcd0e2958651bb1735b261060f
push id99530
push usererahm@mozilla.com
push dateFri, 02 Feb 2018 22:02:46 +0000
treeherdermozilla-inbound@38fdcb96bb92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1434689
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 1434689 - Part 4: Annotate IgnoreErrors as MOZ_TEMPORARY_CLASS. r=bz IgnoreErrors is intended to only be used as a temporary class, this adds an explicit annotation.
dom/bindings/ErrorResult.h
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -27,16 +27,17 @@
 
 #include <stdarg.h>
 
 #include "js/GCAnnotations.h"
 #include "js/Value.h"
 #include "nscore.h"
 #include "nsString.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/Move.h"
 #include "nsTArray.h"
 #include "nsISupportsImpl.h"
 
 namespace IPC {
 class Message;
 template <typename> struct ParamTraits;
 } // namespace IPC
@@ -602,17 +603,17 @@ class IgnoredErrorResult :
 {
 };
 
 // A class for use when an ErrorResult should just automatically be
 // ignored.  This is designed to be passed as a temporary only, like
 // so:
 //
 //    foo->Bar(IgnoreErrors());
-class IgnoreErrors {
+class MOZ_TEMPORARY_CLASS IgnoreErrors {
 public:
   operator ErrorResult&() && { return mInner; }
 private:
   // We don't use an ErrorResult member here so we don't make two separate calls
   // to SuppressException (one from us, one from the ErrorResult destructor
   // after asserting).
   binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy> mInner;
 };