Bug 803471 - Part 1a - Enable Binder ThreadPool. r=mwu

This commit is contained in:
Sotaro Ikeda 2013-03-08 14:43:32 -05:00
parent f70a443dfa
commit 12c26d0257
2 changed files with 24 additions and 0 deletions

View File

@ -37,6 +37,10 @@
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
#ifdef MOZ_WIDGET_GONK
# include <binder/ProcessState.h>
#endif
#include "mozilla/Telemetry.h"
static void Output(const char *fmt, ... )
@ -168,6 +172,14 @@ int main(int argc, char* argv[])
{
char exePath[MAXPATHLEN];
#ifdef MOZ_WIDGET_GONK
// This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
// receive binder calls, though not necessary to send binder calls.
// ProcessState::Self() also needs to be called once on the main thread to
// register the main thread with the binder driver.
android::ProcessState::self()->startThreadPool();
#endif
nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.\n");

View File

@ -22,9 +22,21 @@
#include "nsSetDllDirectory.h"
#endif
#ifdef MOZ_WIDGET_GONK
# include <binder/ProcessState.h>
#endif
int
main(int argc, char* argv[])
{
#ifdef MOZ_WIDGET_GONK
// This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
// receive binder calls, though not necessary to send binder calls.
// ProcessState::Self() also needs to be called once on the main thread to
// register the main thread with the binder driver.
android::ProcessState::self()->startThreadPool();
#endif
#if defined(XP_WIN) && defined(DEBUG_bent)
MessageBox(NULL, L"Hi", L"Hi", MB_OK);
#endif