OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "app/app_paths.h" | 5 #include "app/app_paths.h" |
6 #include "app/app_switches.h" | 6 #include "app/app_switches.h" |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 base::EnableTerminationOnOutOfMemory(); | 243 base::EnableTerminationOnOutOfMemory(); |
244 #endif // OS_MACOSX | 244 #endif // OS_MACOSX |
245 | 245 |
246 #if defined(OS_POSIX) | 246 #if defined(OS_POSIX) |
247 // Set C library locale to make sure CommandLine can parse argument values | 247 // Set C library locale to make sure CommandLine can parse argument values |
248 // in correct encoding. | 248 // in correct encoding. |
249 setlocale(LC_ALL, ""); | 249 setlocale(LC_ALL, ""); |
250 | 250 |
251 SetupSignalHandlers(); | 251 SetupSignalHandlers(); |
252 | 252 |
253 typedef Singleton<base::GlobalDescriptors, | 253 base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetLeakyInstance(); |
254 LeakySingletonTraits<base::GlobalDescriptors> > | |
255 GlobalDescriptorsSingleton; | |
256 base::GlobalDescriptors* g_fds = GlobalDescriptorsSingleton::get(); | |
257 g_fds->Set(kPrimaryIPCChannel, | 254 g_fds->Set(kPrimaryIPCChannel, |
258 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); | 255 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); |
259 #if defined(OS_LINUX) | 256 #if defined(OS_LINUX) |
260 g_fds->Set(kCrashDumpSignal, | 257 g_fds->Set(kCrashDumpSignal, |
261 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); | 258 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); |
262 #endif | 259 #endif |
263 #endif // OS_POSIX | 260 #endif // OS_POSIX |
264 } | 261 } |
265 | 262 |
266 // Perform last-second shutdown work. Partner of LowLevelInit(). | 263 // Perform last-second shutdown work. Partner of LowLevelInit(). |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 904 |
908 int exit_code = RunNamedProcessTypeMain(process_type, main_params); | 905 int exit_code = RunNamedProcessTypeMain(process_type, main_params); |
909 | 906 |
910 if (SubprocessNeedsResourceBundle(process_type)) | 907 if (SubprocessNeedsResourceBundle(process_type)) |
911 ResourceBundle::CleanupSharedInstance(); | 908 ResourceBundle::CleanupSharedInstance(); |
912 | 909 |
913 LowLevelShutdown(); | 910 LowLevelShutdown(); |
914 | 911 |
915 return exit_code; | 912 return exit_code; |
916 } | 913 } |
OLD | NEW |