mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 969469: use SyncRunnable to get local interface information on gonk. r=bwc
This commit is contained in:
parent
e8d1759e6d
commit
9daa614006
@ -18,6 +18,7 @@ extern "C" {
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
|
||||
namespace {
|
||||
struct NetworkInterface {
|
||||
@ -104,12 +105,11 @@ nr_stun_get_addrs(nr_local_addr aAddrs[], int aMaxAddrs,
|
||||
|
||||
// Get network interface list.
|
||||
std::vector<NetworkInterface> interfaces;
|
||||
if (NS_FAILED(NS_DispatchToMainThread(
|
||||
mozilla::WrapRunnableNMRet(&GetInterfaces, &interfaces, &rv),
|
||||
NS_DISPATCH_SYNC))) {
|
||||
return R_FAILED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
|
||||
mozilla::SyncRunnable::DispatchToThread(
|
||||
mainThread.get(),
|
||||
mozilla::WrapRunnableNMRet(&GetInterfaces, &interfaces, &rv),
|
||||
false);
|
||||
if (NS_FAILED(rv)) {
|
||||
return R_FAILED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user