ipc/app/MozillaRuntimeMainAndroid.cpp

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * vim: sw=4 ts=4 et :
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include <dlfcn.h>
     8 #include <android/log.h>
    10 int
    11 main(int argc, char* argv[])
    12 {
    13     // Check for the absolute minimum number of args we need to move
    14     // forward here. We expect the last arg to be the child process type.
    15     if (argc < 2)
    16         return 1;
    18     void *mozloader_handle = dlopen("libmozglue.so", RTLD_LAZY);
    19     if (!mozloader_handle) {
    20       __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
    21                           "Couldn't load mozloader because %s", dlerror());
    22         return 1;
    23     }
    25     typedef int (*ChildProcessInit_t)(int, char**);
    26     ChildProcessInit_t fChildProcessInit =
    27         (ChildProcessInit_t)dlsym(mozloader_handle, "ChildProcessInit");
    28     if (!fChildProcessInit) {
    29         __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
    30                             "Couldn't load cpi_t because %s", dlerror());
    31         return 1;
    32     }
    34     return fChildProcessInit(argc, argv);
    35 }

mercurial