Bug 1260243 - Add GeckoThread.waitOnGecko; r=snorp

GeckoThread.waitOnGecko blocks the current thread and waits for previous
events on the Gecko thread to finish executing before continuing. This
is implemented by synchronously running a dummy event on the Gecko
thread. This patch also lets us get rid of sendEventToGeckoSync in
GeckoAppShell.
This commit is contained in:
Jim Chen
2016-04-05 21:43:40 -04:00
parent 01c8ac624e
commit 0a0568bae4
8 changed files with 40 additions and 8 deletions

View File

@@ -182,6 +182,14 @@ public:
}
specConn->SpeculativeConnect(uri, nullptr);
}
static void WaitOnGecko()
{
struct NoOpEvent : nsAppShell::Event {
void Run() override {}
};
nsAppShell::SyncRunEvent(NoOpEvent());
}
};
class GeckoAppShellSupport final