From 316a8afe47e201c499aa0f5bfae942467514beba Mon Sep 17 00:00:00 2001 From: JW Wang Date: Wed, 3 May 2017 12:34:50 +0800 Subject: [PATCH] Bug 1361942 - Store ActualArgTypes instead of ArgTypes for we are sending data of ActualArgTypes types to another thread. r=gerald This allows more use of the implicit version of InvokeAsync() without specifying the storage types explicitly. MozReview-Commit-ID: 40WisaVX8Jy --HG-- extra : rebase_source : ba34515788f0bc8264fac9a6897e234966d8b762 extra : source : b651963fe562755c0b2998ae6a95ffad400060ad --- dom/media/gmp/GMPParent.cpp | 2 +- dom/media/gmp/GMPServiceParent.cpp | 2 +- xpcom/threads/MozPromise.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 13726d38ba3b..a0f48ce68a06 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -725,7 +725,7 @@ GMPParent::ReadChromiumManifestFile(nsIFile* aFile) } // DOM JSON parsing needs to run on the main thread. - return InvokeAsync( + return InvokeAsync( mMainThread, this, __func__, &GMPParent::ParseChromiumManifest, NS_ConvertUTF8toUTF16(json)); } diff --git a/dom/media/gmp/GMPServiceParent.cpp b/dom/media/gmp/GMPServiceParent.cpp index 36c79297cd14..7430692f6ea8 100644 --- a/dom/media/gmp/GMPServiceParent.cpp +++ b/dom/media/gmp/GMPServiceParent.cpp @@ -642,7 +642,7 @@ GeckoMediaPluginServiceParent::AsyncAddPluginDirectory(const nsAString& aDirecto nsString dir(aDirectory); RefPtr self = this; - return InvokeAsync( + return InvokeAsync( thread, this, __func__, &GeckoMediaPluginServiceParent::AddOnGMPThread, dir) ->Then( diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index 97f0ea21f0d1..3f95004a5699 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -1328,11 +1328,11 @@ InvokeAsync(AbstractThread* aTarget, ThisType* aThisVal, const char* aCallerName RefPtr(ThisType::*aMethod)(ArgTypes...), ActualArgTypes&&... aArgs) { - static_assert(!detail::Any(IsPointer::value...), + static_assert(!detail::Any(IsPointer::Type>::value...), "Cannot pass pointer types through InvokeAsync, Storages must be provided"); static_assert(sizeof...(ArgTypes) == sizeof...(ActualArgTypes), "Method's ArgTypes and ActualArgTypes should have equal sizes"); - return detail::InvokeAsyncImpl::Type>...>( + return detail::InvokeAsyncImpl::Type>...>( aTarget, aThisVal, aCallerName, aMethod, Forward(aArgs)...); }