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/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 // dump. | 572 // dump. |
573 // | 573 // |
574 // What we do: | 574 // What we do: |
575 // * We only pass crashes for foreground processes to Apple's Crash | 575 // * We only pass crashes for foreground processes to Apple's Crash |
576 // reporter. At the time of this writing, that means just the Browser | 576 // reporter. At the time of this writing, that means just the Browser |
577 // process. | 577 // process. |
578 // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter | 578 // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter |
579 // itself. | 579 // itself. |
580 // * If Breakpad is disabled, we only turn on Crash Reporter for the | 580 // * If Breakpad is disabled, we only turn on Crash Reporter for the |
581 // Browser process in release mode. | 581 // Browser process in release mode. |
582 if (!command_line.HasSwitch(switches::kDisableBreakpad)) { | 582 if (base::mac::IsBackgroundOnlyProcess() || |
583 bool disable_apple_crash_reporter = is_debug_build || | 583 breakpad::IsCrashReporterEnabled() || |
584 base::mac::IsBackgroundOnlyProcess(); | 584 is_debug_build) { |
585 if (!breakpad::IsCrashReporterEnabled() && disable_apple_crash_reporter) { | 585 base::mac::DisableOSCrashDumps(); |
586 base::mac::DisableOSCrashDumps(); | |
587 } | |
588 } | 586 } |
589 | 587 |
590 // Mac Chrome is packaged with a main app bundle and a helper app bundle. | 588 // Mac Chrome is packaged with a main app bundle and a helper app bundle. |
591 // The main app bundle should only be used for the browser process, so it | 589 // The main app bundle should only be used for the browser process, so it |
592 // should never see a --type switch (switches::kProcessType). Likewise, | 590 // should never see a --type switch (switches::kProcessType). Likewise, |
593 // the helper should always have a --type switch. | 591 // the helper should always have a --type switch. |
594 // | 592 // |
595 // This check is done this late so there is already a call to | 593 // This check is done this late so there is already a call to |
596 // base::mac::IsBackgroundOnlyProcess(), so there is no change in | 594 // base::mac::IsBackgroundOnlyProcess(), so there is no change in |
597 // startup/initialization order. | 595 // startup/initialization order. |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 } | 918 } |
921 | 919 |
922 content::ContentUtilityClient* | 920 content::ContentUtilityClient* |
923 ChromeMainDelegate::CreateContentUtilityClient() { | 921 ChromeMainDelegate::CreateContentUtilityClient() { |
924 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 922 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
925 return NULL; | 923 return NULL; |
926 #else | 924 #else |
927 return g_chrome_content_utility_client.Pointer(); | 925 return g_chrome_content_utility_client.Pointer(); |
928 #endif | 926 #endif |
929 } | 927 } |
OLD | NEW |