1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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/. */
8 #include "nsXULAppAPI.h"
9 #include "mozilla/Bootstrap.h"
10 #include "XREChildData.h"
14 // we want a wmain entry point
15 # include "nsWindowsWMain.cpp"
17 // FIXME/cjones testing
21 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
22 # include "mozilla/sandboxing/SandboxInitialization.h"
23 # include "mozilla/sandboxing/sandboxLogging.h"
26 int content_process_main(mozilla::Bootstrap
* bootstrap
, int argc
,
28 // Check for the absolute minimum number of args we need to move
29 // forward here. We expect the last arg to be the child process type.
34 XREChildData childData
;
36 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
37 if (IsSandboxedProcess()) {
38 childData
.sandboxTargetServices
=
39 mozilla::sandboxing::GetInitializedTargetServices();
40 if (!childData
.sandboxTargetServices
) {
44 childData
.ProvideLogFunction
= mozilla::sandboxing::ProvideLogFunction
;
48 bootstrap
->XRE_SetProcessType(argv
[--argc
]);
50 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
51 if (bootstrap
->XRE_GetProcessType() == GeckoProcessType_RemoteSandboxBroker
) {
52 childData
.sandboxBrokerServices
=
53 mozilla::sandboxing::GetInitializedBrokerServices();
57 nsresult rv
= bootstrap
->XRE_InitChildProcess(argc
, argv
, &childData
);