Fix Mac build with disable_nacl=1.

switches::kNaClLoaderProcess is referenced by chrome_main_delegate.cc
but isn't found by the linker.

BUG=None

Review URL: https://codereview.chromium.org/398323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283771 0039d316-1c4b-4281-b951-d872f2087c98
parent 12dc163f
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/utility/chrome_content_utility_client.h" #include "chrome/utility/chrome_content_utility_client.h"
#include "components/component_updater/component_updater_paths.h" #include "components/component_updater/component_updater_paths.h"
#include "components/nacl/common/nacl_switches.h"
#include "components/startup_metric_utils/startup_metric_utils.h" #include "components/startup_metric_utils/startup_metric_utils.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
#include "content/public/common/content_paths.h" #include "content/public/common/content_paths.h"
...@@ -109,6 +108,10 @@ ...@@ -109,6 +108,10 @@
#include "chrome/browser/policy/policy_path_parser.h" #include "chrome/browser/policy/policy_path_parser.h"
#endif #endif
#if !defined(DISABLE_NACL)
#include "components/nacl/common/nacl_switches.h"
#endif
#if !defined(CHROME_MULTIPLE_DLL_CHILD) #if !defined(CHROME_MULTIPLE_DLL_CHILD)
base::LazyInstance<chrome::ChromeContentBrowserClient> base::LazyInstance<chrome::ChromeContentBrowserClient>
g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER;
...@@ -234,7 +237,9 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) { ...@@ -234,7 +237,9 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Mac needs them too for scrollbar related images and for sandbox // Mac needs them too for scrollbar related images and for sandbox
// profiles. // profiles.
#if !defined(DISABLE_NACL)
process_type == switches::kNaClLoaderProcess || process_type == switches::kNaClLoaderProcess ||
#endif
process_type == switches::kPpapiPluginProcess || process_type == switches::kPpapiPluginProcess ||
process_type == switches::kPpapiBrokerProcess || process_type == switches::kPpapiBrokerProcess ||
process_type == switches::kGpuProcess || process_type == switches::kGpuProcess ||
...@@ -598,15 +603,23 @@ void ChromeMainDelegate::InitMacCrashReporter( ...@@ -598,15 +603,23 @@ void ChromeMainDelegate::InitMacCrashReporter(
<< switches::kPluginProcess << " or " << switches::kPluginProcess << " or "
<< switches::kUtilityProcess << ", saw " << process_type; << switches::kUtilityProcess << ", saw " << process_type;
} else if (last_three == " NP") { } else if (last_three == " NP") {
#if !defined(DISABLE_NACL)
CHECK_EQ(switches::kNaClLoaderProcess, process_type) CHECK_EQ(switches::kNaClLoaderProcess, process_type)
<< "Non-PIE process requires --type=" << "Non-PIE process requires --type="
<< switches::kNaClLoaderProcess << ", saw " << process_type; << switches::kNaClLoaderProcess << ", saw " << process_type;
#endif
} else { } else {
#if defined(DISABLE_NACL)
CHECK(process_type != switches::kPluginProcess)
<< "Non-executable-heap PIE process is intolerant of --type="
<< switches::kPluginProcess;
#else
CHECK(process_type != switches::kPluginProcess && CHECK(process_type != switches::kPluginProcess &&
process_type != switches::kNaClLoaderProcess) process_type != switches::kNaClLoaderProcess)
<< "Non-executable-heap PIE process is intolerant of --type=" << "Non-executable-heap PIE process is intolerant of --type="
<< switches::kPluginProcess << " and " << switches::kPluginProcess << " and "
<< switches::kNaClLoaderProcess << ", saw " << process_type; << switches::kNaClLoaderProcess << ", saw " << process_type;
#endif
} }
} }
} else { } else {
...@@ -829,7 +842,11 @@ void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { ...@@ -829,7 +842,11 @@ void ChromeMainDelegate::ProcessExiting(const std::string& process_type) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
bool ChromeMainDelegate::ProcessRegistersWithSystemProcess( bool ChromeMainDelegate::ProcessRegistersWithSystemProcess(
const std::string& process_type) { const std::string& process_type) {
#if defined(DISABLE_NACL)
return false;
#else
return process_type == switches::kNaClLoaderProcess; return process_type == switches::kNaClLoaderProcess;
#endif
} }
bool ChromeMainDelegate::ShouldSendMachPort(const std::string& process_type) { bool ChromeMainDelegate::ShouldSendMachPort(const std::string& process_type) {
...@@ -839,10 +856,13 @@ bool ChromeMainDelegate::ShouldSendMachPort(const std::string& process_type) { ...@@ -839,10 +856,13 @@ bool ChromeMainDelegate::ShouldSendMachPort(const std::string& process_type) {
bool ChromeMainDelegate::DelaySandboxInitialization( bool ChromeMainDelegate::DelaySandboxInitialization(
const std::string& process_type) { const std::string& process_type) {
#if !defined(DISABLE_NACL)
// NaClLoader does this in NaClMainPlatformDelegate::EnableSandbox(). // NaClLoader does this in NaClMainPlatformDelegate::EnableSandbox().
// No sandbox needed for relauncher. // No sandbox needed for relauncher.
return process_type == switches::kNaClLoaderProcess || if (process_type == switches::kNaClLoaderProcess)
process_type == switches::kRelauncherProcess; return true;
#endif
return process_type == switches::kRelauncherProcess;
} }
#elif defined(OS_POSIX) && !defined(OS_ANDROID) #elif defined(OS_POSIX) && !defined(OS_ANDROID)
void ChromeMainDelegate::ZygoteStarting( void ChromeMainDelegate::ZygoteStarting(
......
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