/src/mozilla-central/ipc/contentproc/plugin-container.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #include "nsXPCOM.h" |
8 | | #include "nsXULAppAPI.h" |
9 | | #include "mozilla/Bootstrap.h" |
10 | | |
11 | | #ifdef XP_WIN |
12 | | #include <windows.h> |
13 | | // we want a wmain entry point |
14 | | #include "nsWindowsWMain.cpp" |
15 | | #else |
16 | | // FIXME/cjones testing |
17 | | #include <unistd.h> |
18 | | #endif |
19 | | |
20 | | #if defined(XP_WIN) && defined(MOZ_SANDBOX) |
21 | | #include "mozilla/sandboxing/SandboxInitialization.h" |
22 | | #include "mozilla/sandboxing/sandboxLogging.h" |
23 | | #endif |
24 | | |
25 | | int |
26 | | content_process_main(mozilla::Bootstrap* bootstrap, int argc, char* argv[]) |
27 | 0 | { |
28 | 0 | // Check for the absolute minimum number of args we need to move |
29 | 0 | // forward here. We expect the last arg to be the child process type. |
30 | 0 | if (argc < 1) { |
31 | 0 | return 3; |
32 | 0 | } |
33 | 0 | |
34 | 0 | XREChildData childData; |
35 | 0 |
|
36 | | #if defined(XP_WIN) && defined(MOZ_SANDBOX) |
37 | | if (IsSandboxedProcess()) { |
38 | | childData.sandboxTargetServices = |
39 | | mozilla::sandboxing::GetInitializedTargetServices(); |
40 | | if (!childData.sandboxTargetServices) { |
41 | | return 1; |
42 | | } |
43 | | |
44 | | childData.ProvideLogFunction = mozilla::sandboxing::ProvideLogFunction; |
45 | | } |
46 | | #endif |
47 | |
|
48 | 0 | bootstrap->XRE_SetProcessType(argv[--argc]); |
49 | 0 |
|
50 | 0 | nsresult rv = bootstrap->XRE_InitChildProcess(argc, argv, &childData); |
51 | 0 | return NS_FAILED(rv); |
52 | 0 | } |