Bug 1332779 - InvokeAsync's MethodCall constructor should take forwarding refs instead of lvalues - r=jwwang
authorGerald Squelart <gsquelart@mozilla.com>
Sat, 21 Jan 2017 12:04:54 +1100
changeset 375588 3666ff5c8e0a4a1a457c1af087fd14c09bf11a01
parent 375587 9fd9ab0fdefa47fabd220c49732514e861bc9fcc
child 375589 8ac365ab3cfb611c5e85f24f533ac6399cdf0240
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1332779
milestone53.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 1332779 - InvokeAsync's MethodCall constructor should take forwarding refs instead of lvalues - r=jwwang The aArgs parameter pack was already Forward'ed inside the constructor, so maybe the '&&' was forgotten? MozReview-Commit-ID: 7yg07axhZnp
xpcom/threads/MozPromise.h
--- a/xpcom/threads/MozPromise.h
+++ b/xpcom/threads/MozPromise.h
@@ -1117,17 +1117,17 @@ public:
 };
 
 template<typename PromiseType, typename MethodType, typename ThisType,
          typename... Storages>
 class MethodCall : public MethodCallBase
 {
 public:
   template<typename... Args>
-  MethodCall(MethodType aMethod, ThisType* aThisVal, Args... aArgs)
+  MethodCall(MethodType aMethod, ThisType* aThisVal, Args&&... aArgs)
     : mMethod(aMethod)
     , mThisVal(aThisVal)
     , mArgs(Forward<Args>(aArgs)...)
   {
     static_assert(sizeof...(Storages) == sizeof...(Args), "Storages and Args should have equal sizes");
   }
 
   RefPtr<PromiseType> Invoke()