Bug 1387314-Remove NS_DispatchToMainThread and use nsIEventTarget to dispatch instead. r=cpearce

MozReview-Commit-ID: EcEQlLLhU5z

--HG--
extra : rebase_source : bc44b7815a80bb1c63a0a32c82936eac3a311108
This commit is contained in:
James Cheng 2017-08-04 11:31:15 +08:00
Родитель 89e1924c8f
Коммит 238e3be549
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -61,6 +61,8 @@ namespace mozilla {
#endif
#define __CLASS__ "GMPService"
#define NS_DispatchToMainThread(...) CompileError_UseAbstractMainThreadInstead
namespace gmp {
static const uint32_t NodeIdSaltLength = 32;
@ -1887,8 +1889,10 @@ GMPServiceParent::ActorDestroy(ActorDestroyReason aWhy)
NS_DispatchToCurrentThread(
NS_NewRunnableFunction("gmp::GMPServiceParent::ActorDestroy", [self]() {
// The GMPServiceParent must be destroyed on the main thread.
NS_DispatchToMainThread(NS_NewRunnableFunction(
"gmp::GMPServiceParent::ActorDestroy", [self]() { delete self; }));
self->mService->mMainThread->Dispatch(
NS_NewRunnableFunction(
"gmp::GMPServiceParent::ActorDestroy", [self]() { delete self; }),
NS_DISPATCH_NORMAL);
}));
}
@ -1953,3 +1957,5 @@ GMPServiceParent::Create(Endpoint<PGMPServiceParent>&& aGMPService)
} // namespace gmp
} // namespace mozilla
#undef NS_DispatchToMainThread