Bug 1157488 - Don't spin the event loop by synchronously dispatching when we're already on the main thread. r=jww

This was causing us to re-enter RunSyncSectionsInternal.
This commit is contained in:
Bobby Holley 2015-04-22 15:21:55 -07:00
parent 9d831360d9
commit 593c23f2d0

View File

@ -421,7 +421,12 @@ already_AddRefed<AndroidMediaResourceServer>
AndroidMediaResourceServer::Start()
{
nsRefPtr<AndroidMediaResourceServer> server = new AndroidMediaResourceServer();
NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
// We should fix this up - see bug 1157476.
if (NS_IsMainThread()) {
server->Run();
} else {
NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
}
return server.forget();
}