| 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 breakpad::InitNonBrowserCrashReporterForAndroid(process_type); | 797 breakpad::InitNonBrowserCrashReporterForAndroid(process_type); |
| 798 } | 798 } |
| 799 #else // !defined(OS_ANDROID) | 799 #else // !defined(OS_ANDROID) |
| 800 breakpad::InitCrashReporter(process_type); | 800 breakpad::InitCrashReporter(process_type); |
| 801 #endif // defined(OS_ANDROID) | 801 #endif // defined(OS_ANDROID) |
| 802 } | 802 } |
| 803 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 803 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 804 | 804 |
| 805 // After all the platform Breakpads have been initialized, store the command | 805 // After all the platform Breakpads have been initialized, store the command |
| 806 // line for crash reporting. | 806 // line for crash reporting. |
| 807 crash_keys::SetSwitchesFromCommandLine(&command_line); | 807 crash_keys::SetCrashKeysFromCommandLine(command_line); |
| 808 } | 808 } |
| 809 | 809 |
| 810 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { | 810 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { |
| 811 // Note: If you are adding a new process type below, be sure to adjust the | 811 // Note: If you are adding a new process type below, be sure to adjust the |
| 812 // AdjustLinuxOOMScore function too. | 812 // AdjustLinuxOOMScore function too. |
| 813 #if defined(OS_LINUX) | 813 #if defined(OS_LINUX) |
| 814 AdjustLinuxOOMScore(process_type); | 814 AdjustLinuxOOMScore(process_type); |
| 815 #endif | 815 #endif |
| 816 #if defined(OS_WIN) | 816 #if defined(OS_WIN) |
| 817 InitLogging(process_type); | 817 InitLogging(process_type); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 | 927 |
| 928 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 928 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
| 929 // this up for the browser process in a different manner. | 929 // this up for the browser process in a different manner. |
| 930 const base::CommandLine* command_line = | 930 const base::CommandLine* command_line = |
| 931 base::CommandLine::ForCurrentProcess(); | 931 base::CommandLine::ForCurrentProcess(); |
| 932 std::string process_type = | 932 std::string process_type = |
| 933 command_line->GetSwitchValueASCII(switches::kProcessType); | 933 command_line->GetSwitchValueASCII(switches::kProcessType); |
| 934 breakpad::InitCrashReporter(process_type); | 934 breakpad::InitCrashReporter(process_type); |
| 935 | 935 |
| 936 // Reset the command line for the newly spawned process. | 936 // Reset the command line for the newly spawned process. |
| 937 crash_keys::SetSwitchesFromCommandLine(command_line); | 937 crash_keys::SetCrashKeysFromCommandLine(*command_line); |
| 938 } | 938 } |
| 939 | 939 |
| 940 #endif // OS_MACOSX | 940 #endif // OS_MACOSX |
| 941 | 941 |
| 942 content::ContentBrowserClient* | 942 content::ContentBrowserClient* |
| 943 ChromeMainDelegate::CreateContentBrowserClient() { | 943 ChromeMainDelegate::CreateContentBrowserClient() { |
| 944 #if defined(CHROME_MULTIPLE_DLL_CHILD) | 944 #if defined(CHROME_MULTIPLE_DLL_CHILD) |
| 945 return NULL; | 945 return NULL; |
| 946 #else | 946 #else |
| 947 return g_chrome_content_browser_client.Pointer(); | 947 return g_chrome_content_browser_client.Pointer(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 case version_info::Channel::CANARY: | 980 case version_info::Channel::CANARY: |
| 981 return true; | 981 return true; |
| 982 case version_info::Channel::DEV: | 982 case version_info::Channel::DEV: |
| 983 case version_info::Channel::BETA: | 983 case version_info::Channel::BETA: |
| 984 case version_info::Channel::STABLE: | 984 case version_info::Channel::STABLE: |
| 985 default: | 985 default: |
| 986 // Don't enable instrumentation. | 986 // Don't enable instrumentation. |
| 987 return false; | 987 return false; |
| 988 } | 988 } |
| 989 } | 989 } |
| OLD | NEW |