OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 InitMacCrashReporter(command_line, process_type); | 561 InitMacCrashReporter(command_line, process_type); |
562 #endif | 562 #endif |
563 | 563 |
564 // Notice a user data directory override if any | 564 // Notice a user data directory override if any |
565 FilePath user_data_dir = | 565 FilePath user_data_dir = |
566 command_line.GetSwitchValuePath(switches::kUserDataDir); | 566 command_line.GetSwitchValuePath(switches::kUserDataDir); |
567 #if defined(OS_MACOSX) || defined(OS_WIN) | 567 #if defined(OS_MACOSX) || defined(OS_WIN) |
568 CheckUserDataDirPolicy(&user_data_dir); | 568 CheckUserDataDirPolicy(&user_data_dir); |
569 #endif | 569 #endif |
570 if (!user_data_dir.empty()) | 570 if (!user_data_dir.empty()) { |
571 CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); | 571 CHECK(PathService::OverrideAndCreateIfNeeded( |
| 572 chrome::DIR_USER_DATA, |
| 573 user_data_dir, |
| 574 chrome::ProcessNeedsProfileDir(process_type))); |
| 575 } |
572 | 576 |
573 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> | 577 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> |
574 (content::Counters::chrome_main())); | 578 (content::Counters::chrome_main())); |
575 | 579 |
576 // Enable the heap profiler as early as possible! | 580 // Enable the heap profiler as early as possible! |
577 EnableHeapProfiler(command_line); | 581 EnableHeapProfiler(command_line); |
578 | 582 |
579 // Enable Message Loop related state asap. | 583 // Enable Message Loop related state asap. |
580 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 584 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
581 MessageLoop::EnableHistogrammer(true); | 585 MessageLoop::EnableHistogrammer(true); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 728 |
725 #if defined(USE_LINUX_BREAKPAD) | 729 #if defined(USE_LINUX_BREAKPAD) |
726 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 730 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
727 // this up for the browser process in a different manner. | 731 // this up for the browser process in a different manner. |
728 InitCrashReporter(); | 732 InitCrashReporter(); |
729 #endif | 733 #endif |
730 | 734 |
731 InitializeChromeContentClient(process_type); | 735 InitializeChromeContentClient(process_type); |
732 } | 736 } |
733 #endif // OS_MACOSX | 737 #endif // OS_MACOSX |
OLD | NEW |