Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: content/app/content_main_runner.cc

Issue 10907062: Minimal number of if-def changes to support OS_IOS in content_main_runner.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 4d76ab1f5170d86e479d12bfb8e9bd007a88ab05..ff29eaa0e0affbbab21d4f23a16d28e160b3f3b2 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -57,10 +57,12 @@
#include <malloc.h>
#elif defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
+#if !defined(OS_IOS)
#include "base/mach_ipc_mac.h"
#include "base/system_monitor/system_monitor.h"
#include "content/browser/mach_broker_mac.h"
#include "content/common/sandbox_init_mac.h"
+#endif // !OS_IOS
#endif // OS_WIN
#if defined(OS_POSIX)
@@ -110,7 +112,7 @@ base::LazyInstance<ContentUtilityClient>
static CAppModule _Module;
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) && !defined(OS_IOS)
// Completes the Mach IPC handshake by sending this process' task port to the
// parent process. The parent is listening on the Mach port given by
@@ -187,6 +189,7 @@ void CommonSubprocessInit(const std::string& process_type) {
static base::ProcessId GetBrowserPid(const CommandLine& command_line) {
base::ProcessId browser_pid = base::GetCurrentProcId();
+#if !defined(OS_IOS)
if (command_line.HasSwitch(switches::kProcessChannelID)) {
#if defined(OS_WIN) || defined(OS_MACOSX)
std::string channel_name =
@@ -214,6 +217,7 @@ static base::ProcessId GetBrowserPid(const CommandLine& command_line) {
base::GetParentProcessId(base::GetCurrentProcId()));
#endif
}
+#endif // !OS_IOS
return browser_pid;
}
@@ -349,6 +353,10 @@ int RunNamedProcessTypeMain(
const std::string& process_type,
const MainFunctionParams& main_function_params,
ContentMainDelegate* delegate) {
+#if defined(OS_IOS)
+ // None of the *Main processes exist on iOS.
+ NOTREACHED();
+#else
static const MainFunction kMainFunctions[] = {
{ "", BrowserMain },
{ switches::kRendererProcess, RendererMain },
@@ -392,6 +400,7 @@ int RunNamedProcessTypeMain(
return delegate->RunProcess(process_type, main_function_params);
NOTREACHED() << "Unknown process type: " << process_type;
+#endif // !OS_IOS
return 1;
}
@@ -477,12 +486,14 @@ static void ReleaseFreeMemoryThunk() {
// in correct encoding.
setlocale(LC_ALL, "");
jam 2012/09/04 19:38:49 do you really need this on ios? if not, then just
leng 2012/09/05 11:57:10 All our tests passed without it. Done.
+#if !defined(OS_IOS)
SetupSignalHandlers();
base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance();
g_fds->Set(kPrimaryIPCChannel,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
-#endif
+#endif // !OS_IOS
+#endif // !OS_ANDROID
#if defined(OS_LINUX) || defined(OS_OPENBSD)
g_fds->Set(kCrashDumpSignal,
@@ -498,7 +509,8 @@ static void ReleaseFreeMemoryThunk() {
base::EnableTerminationOnOutOfMemory();
// On Android, AtExitManager is set up when library is loaded.
-#if !defined(OS_ANDROID)
+ // On iOS, it's set up in main(), which can't call directly through to here.
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
jam 2012/09/04 19:38:49 i would then combined this with the ifdef at 484 (
leng 2012/09/05 11:57:10 Done.
// The exit manager is in charge of calling the dtors of singleton objects.
exit_manager_.reset(new base::AtExitManager);
#endif
@@ -543,7 +555,7 @@ static void ReleaseFreeMemoryThunk() {
command_line.GetSwitchValueASCII(switches::kTraceStartup));
}
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) && !defined(OS_IOS)
// We need to allocate the IO Ports before the Sandbox is initialized or
// the first instance of SystemMonitor is created.
// It's important not to allocate the ports for processes which don't
@@ -615,7 +627,7 @@ static void ReleaseFreeMemoryThunk() {
#if defined(OS_WIN)
CHECK(InitializeSandbox(sandbox_info));
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) && !defined(OS_IOS)
if (process_type == switches::kRendererProcess ||
process_type == switches::kPpapiPluginProcess ||
(delegate && delegate->DelaySandboxInitialization(process_type))) {
@@ -629,7 +641,7 @@ static void ReleaseFreeMemoryThunk() {
if (delegate)
delegate->SandboxInitialized(process_type);
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) && !defined(OS_IOS)
SetProcessTitleFromCommandLine(argv);
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698