Commit 81ac8fa6 authored by Tom Sepez's avatar Tom Sepez Committed by Commit Bot

Fix zygote ifdefs in content_main_runner.cc

Use the proper BUILDFLAG() macro


Change-Id: I358fd008b5eb081d18782c66e0df904589435140
Reviewed-on: https://chromium-review.googlesource.com/889422
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532707}
parent a9d98e66
......@@ -52,6 +52,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/sandbox_init.h"
#include "content/public/common/zygote_features.h"
#include "gin/v8_initializer.h"
#include "media/base/media.h"
#include "media/media_features.h"
......@@ -300,18 +301,18 @@ struct MainFunction {
int (*function)(const MainFunctionParams&);
};
#if defined(OS_LINUX)
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
// On platforms that use the zygote, we have a special subset of
// subprocesses that are launched via the zygote. This function
// fills in some process-launching bits around ZygoteMain().
// Returns the exit code of the subprocess.
int RunZygote(ContentMainDelegate* delegate) {
static const MainFunction kMainFunctions[] = {
{ switches::kRendererProcess, RendererMain },
{switches::kRendererProcess, RendererMain},
{switches::kUtilityProcess, UtilityMain},
#if BUILDFLAG(ENABLE_PLUGINS)
{ switches::kPpapiPluginProcess, PpapiPluginMain },
{switches::kPpapiPluginProcess, PpapiPluginMain},
#endif
{ switches::kUtilityProcess, UtilityMain },
};
std::vector<std::unique_ptr<ZygoteForkDelegate>> zygote_fork_delegates;
......@@ -357,7 +358,7 @@ int RunZygote(ContentMainDelegate* delegate) {
NOTREACHED() << "Unknown zygote process type: " << process_type;
return 1;
}
#endif // defined(OS_LINUX)
#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
static void RegisterMainThreadFactories() {
#if !defined(CHROME_MULTIPLE_DLL_BROWSER) && !defined(CHROME_MULTIPLE_DLL_CHILD)
......@@ -423,13 +424,12 @@ int RunNamedProcessTypeMain(
}
}
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
!defined(OS_FUCHSIA)
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
// Zygote startup is special -- see RunZygote comments above
// for why we don't use ZygoteMain directly.
if (process_type == switches::kZygoteProcess)
return RunZygote(delegate);
#endif
#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
// If it's a process we don't know about, the embedder should know.
if (delegate)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment