OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // For linux_syscall_support.h. This makes it safe to call embedded system | 5 // For linux_syscall_support.h. This makes it safe to call embedded system |
6 // calls when in seccomp mode. | 6 // calls when in seccomp mode. |
7 | 7 |
8 #include "components/crash/content/app/breakpad_linux.h" | 8 #include "components/crash/content/app/breakpad_linux.h" |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1944 // that if conventional minidump crash reporting is enabled below, it takes | 1944 // that if conventional minidump crash reporting is enabled below, it takes |
1945 // precedence (i.e. its handler is run first) over the microdump handler. | 1945 // precedence (i.e. its handler is run first) over the microdump handler. |
1946 InitMicrodumpCrashHandlerIfNecessary(process_type, sanitization_info); | 1946 InitMicrodumpCrashHandlerIfNecessary(process_type, sanitization_info); |
1947 #endif | 1947 #endif |
1948 // Determine the process type and take appropriate action. | 1948 // Determine the process type and take appropriate action. |
1949 const base::CommandLine& parsed_command_line = | 1949 const base::CommandLine& parsed_command_line = |
1950 *base::CommandLine::ForCurrentProcess(); | 1950 *base::CommandLine::ForCurrentProcess(); |
1951 if (parsed_command_line.HasSwitch(switches::kDisableBreakpad)) | 1951 if (parsed_command_line.HasSwitch(switches::kDisableBreakpad)) |
1952 return; | 1952 return; |
1953 | 1953 |
1954 if (process_type.empty()) { | 1954 bool is_browser_process = |
1955 #if defined(OS_ANDROID) | |
1956 process_type == kWebViewSingleProcessType || | |
1957 process_type == kBrowserProcessType || | |
Torne
2017/04/10 14:06:29
How annoying would it be to change all the uses of
Tobias Sargeant
2017/04/10 14:21:14
It seems like it would be worth it. It's not our c
Robert Sesek
2017/04/10 15:17:18
The process_type.empty() meaning browser is a bake
| |
1958 #endif | |
1959 process_type.empty(); | |
1960 | |
1961 if (is_browser_process) { | |
1955 bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() || | 1962 bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() || |
1956 GetCrashReporterClient()->IsRunningUnattended(); | 1963 GetCrashReporterClient()->IsRunningUnattended(); |
1957 enable_breakpad &= | 1964 enable_breakpad &= |
1958 !parsed_command_line.HasSwitch(switches::kDisableBreakpad); | 1965 !parsed_command_line.HasSwitch(switches::kDisableBreakpad); |
1959 if (!enable_breakpad) { | 1966 if (!enable_breakpad) { |
1960 enable_breakpad = parsed_command_line.HasSwitch( | 1967 enable_breakpad = parsed_command_line.HasSwitch( |
1961 switches::kEnableCrashReporterForTesting); | 1968 switches::kEnableCrashReporterForTesting); |
1962 } | 1969 } |
1963 if (!enable_breakpad) { | 1970 if (!enable_breakpad) { |
1964 VLOG(1) << "Breakpad disabled"; | 1971 VLOG(1) << "Breakpad disabled"; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2079 void SuppressDumpGeneration() { | 2086 void SuppressDumpGeneration() { |
2080 g_dumps_suppressed = G_DUMPS_SUPPRESSED_MAGIC; | 2087 g_dumps_suppressed = G_DUMPS_SUPPRESSED_MAGIC; |
2081 } | 2088 } |
2082 #endif // OS_ANDROID | 2089 #endif // OS_ANDROID |
2083 | 2090 |
2084 bool IsCrashReporterEnabled() { | 2091 bool IsCrashReporterEnabled() { |
2085 return g_is_crash_reporter_enabled; | 2092 return g_is_crash_reporter_enabled; |
2086 } | 2093 } |
2087 | 2094 |
2088 } // namespace breakpad | 2095 } // namespace breakpad |
OLD | NEW |