OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
8 // abstraction. | 8 // abstraction. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 const std::wstring user_data_dir = | 392 const std::wstring user_data_dir = |
393 parsed_command_line.GetSwitchValue(switches::kUserDataDir); | 393 parsed_command_line.GetSwitchValue(switches::kUserDataDir); |
394 if (!user_data_dir.empty()) | 394 if (!user_data_dir.empty()) |
395 CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); | 395 CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); |
396 | 396 |
397 #if defined(OS_LINUX) | 397 #if defined(OS_LINUX) |
398 // Needs to be called after we have chrome::DIR_USER_DATA. | 398 // Needs to be called after we have chrome::DIR_USER_DATA. |
399 InitCrashReporter(); | 399 InitCrashReporter(); |
400 #endif | 400 #endif |
401 | 401 |
402 #if defined(OS_POSIX) | |
403 // Bug 11776: we mistakenly created directories world-readable. | |
404 // Fix old instances of these directories manually. | |
405 // TODO(evanm): remove this code in a month or two. | |
406 if (user_data_dir.empty()) { | |
407 FilePath fix_dir; | |
408 CHECK(PathService::Get(chrome::DIR_USER_DATA, &fix_dir)); | |
409 struct stat statbuf; | |
410 CHECK(stat(fix_dir.value().c_str(), &statbuf) == 0); | |
411 if ((statbuf.st_mode & 0077) != 0) | |
412 CHECK(chmod(fix_dir.value().c_str(), 0700) == 0); | |
Evan Martin
2009/05/29 22:23:03
Let me fix this separately.
In fact, you get a pr
| |
413 } | |
414 #endif | |
415 | |
416 bool single_process = | 402 bool single_process = |
417 #if defined (GOOGLE_CHROME_BUILD) | 403 #if defined (GOOGLE_CHROME_BUILD) |
418 // This is an unsupported and not fully tested mode, so don't enable it for | 404 // This is an unsupported and not fully tested mode, so don't enable it for |
419 // official Chrome builds. | 405 // official Chrome builds. |
420 false; | 406 false; |
421 #else | 407 #else |
422 parsed_command_line.HasSwitch(switches::kSingleProcess); | 408 parsed_command_line.HasSwitch(switches::kSingleProcess); |
423 #endif | 409 #endif |
424 if (single_process) | 410 if (single_process) |
425 RenderProcessHost::set_run_renderer_in_process(true); | 411 RenderProcessHost::set_run_renderer_in_process(true); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 _CrtDumpMemoryLeaks(); | 488 _CrtDumpMemoryLeaks(); |
503 #endif // _CRTDBG_MAP_ALLOC | 489 #endif // _CRTDBG_MAP_ALLOC |
504 | 490 |
505 _Module.Term(); | 491 _Module.Term(); |
506 #endif | 492 #endif |
507 | 493 |
508 logging::CleanupChromeLogging(); | 494 logging::CleanupChromeLogging(); |
509 | 495 |
510 return rv; | 496 return rv; |
511 } | 497 } |
OLD | NEW |