зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
1442e63ce9
Коммит
316a8afe47
|
@ -725,7 +725,7 @@ GMPParent::ReadChromiumManifestFile(nsIFile* aFile)
|
|||
}
|
||||
|
||||
// DOM JSON parsing needs to run on the main thread.
|
||||
return InvokeAsync<nsString&&>(
|
||||
return InvokeAsync(
|
||||
mMainThread, this, __func__,
|
||||
&GMPParent::ParseChromiumManifest, NS_ConvertUTF8toUTF16(json));
|
||||
}
|
||||
|
|
|
@ -642,7 +642,7 @@ GeckoMediaPluginServiceParent::AsyncAddPluginDirectory(const nsAString& aDirecto
|
|||
|
||||
nsString dir(aDirectory);
|
||||
RefPtr<GeckoMediaPluginServiceParent> self = this;
|
||||
return InvokeAsync<nsString&&>(
|
||||
return InvokeAsync(
|
||||
thread, this, __func__,
|
||||
&GeckoMediaPluginServiceParent::AddOnGMPThread, dir)
|
||||
->Then(
|
||||
|
|
|
@ -1328,11 +1328,11 @@ InvokeAsync(AbstractThread* aTarget, ThisType* aThisVal, const char* aCallerName
|
|||
RefPtr<PromiseType>(ThisType::*aMethod)(ArgTypes...),
|
||||
ActualArgTypes&&... aArgs)
|
||||
{
|
||||
static_assert(!detail::Any(IsPointer<ArgTypes>::value...),
|
||||
static_assert(!detail::Any(IsPointer<typename RemoveReference<ActualArgTypes>::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<StoreCopyPassByRRef<typename Decay<ArgTypes>::Type>...>(
|
||||
return detail::InvokeAsyncImpl<StoreCopyPassByRRef<typename Decay<ActualArgTypes>::Type>...>(
|
||||
aTarget, aThisVal, aCallerName, aMethod,
|
||||
Forward<ActualArgTypes>(aArgs)...);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче