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

Unified Diff: content/app/content_main_runner.cc

Issue 10928106: Revert 155980 - Minimal number of if-def changes to support OS_IOS in content_main_runner.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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
===================================================================
--- content/app/content_main_runner.cc (revision 155982)
+++ content/app/content_main_runner.cc (working copy)
@@ -57,12 +57,10 @@
#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)
@@ -112,7 +110,7 @@
static CAppModule _Module;
-#elif defined(OS_MACOSX) && !defined(OS_IOS)
+#elif defined(OS_MACOSX)
// 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
@@ -189,7 +187,6 @@
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 =
@@ -217,7 +214,6 @@
base::GetParentProcessId(base::GetCurrentProcId()));
#endif
}
-#endif // !OS_IOS
return browser_pid;
}
@@ -346,7 +342,6 @@
}
#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
-#if !defined(OS_IOS)
// Run the FooMain() for a given process type.
// If |process_type| is empty, runs BrowserMain().
// Returns the exit code for this process.
@@ -399,7 +394,6 @@
NOTREACHED() << "Unknown process type: " << process_type;
return 1;
}
-#endif // !OS_IOS
class ContentMainRunnerImpl : public ContentMainRunner {
public:
@@ -478,7 +472,7 @@
// stack trace when crashing.
// - The ipc_fd is passed through the Java service.
// Thus, these are all disabled.
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#if !defined(OS_ANDROID)
// Set C library locale to make sure CommandLine can parse argument values
// in correct encoding.
setlocale(LC_ALL, "");
@@ -488,14 +482,8 @@
base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance();
g_fds->Set(kPrimaryIPCChannel,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
+#endif
- // The exit manager is in charge of calling the dtors of singleton objects.
- // On Android, AtExitManager is set up when library is loaded.
- // On iOS, it's set up in main(), which can't call directly through to here.
- exit_manager_.reset(new base::AtExitManager);
-
-#endif // !OS_ANDROID && !OS_IOS
-
#if defined(OS_LINUX) || defined(OS_OPENBSD)
g_fds->Set(kCrashDumpSignal,
kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor);
@@ -509,6 +497,12 @@
base::EnableTerminationOnHeapCorruption();
base::EnableTerminationOnOutOfMemory();
+ // On Android, AtExitManager is set up when library is loaded.
+#if !defined(OS_ANDROID)
+ // The exit manager is in charge of calling the dtors of singleton objects.
+ exit_manager_.reset(new base::AtExitManager);
+#endif
+
#if defined(OS_MACOSX)
// We need this pool for all the objects created before we get to the
// event loop, but we don't want to leave them hanging around until the
@@ -549,7 +543,7 @@
command_line.GetSwitchValueASCII(switches::kTraceStartup));
}
-#if defined(OS_MACOSX) && !defined(OS_IOS)
+#if defined(OS_MACOSX)
// 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
@@ -621,7 +615,7 @@
#if defined(OS_WIN)
CHECK(InitializeSandbox(sandbox_info));
-#elif defined(OS_MACOSX) && !defined(OS_IOS)
+#elif defined(OS_MACOSX)
if (process_type == switches::kRendererProcess ||
process_type == switches::kPpapiPluginProcess ||
(delegate && delegate->DelaySandboxInitialization(process_type))) {
@@ -635,7 +629,7 @@
if (delegate)
delegate->SandboxInitialized(process_type);
-#if defined(OS_POSIX) && !defined(OS_IOS)
+#if defined(OS_POSIX)
SetProcessTitleFromCommandLine(argv);
#endif
@@ -657,11 +651,7 @@
main_params.autorelease_pool = autorelease_pool_.get();
#endif
-#if !defined(OS_IOS)
return RunNamedProcessTypeMain(process_type, main_params, delegate_);
-#else
- return 1;
-#endif
}
virtual void Shutdown() OVERRIDE {
« 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