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/breakpad/app/breakpad_linux.h" | 8 #include "components/breakpad/app/breakpad_linux.h" |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 | 1593 |
1594 #if defined(OS_ANDROID) | 1594 #if defined(OS_ANDROID) |
1595 void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { | 1595 void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { |
1596 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1596 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1597 if (command_line->HasSwitch(switches::kEnableCrashReporter)) { | 1597 if (command_line->HasSwitch(switches::kEnableCrashReporter)) { |
1598 // On Android we need to provide a FD to the file where the minidump is | 1598 // On Android we need to provide a FD to the file where the minidump is |
1599 // generated as the renderer and browser run with different UIDs | 1599 // generated as the renderer and browser run with different UIDs |
1600 // (preventing the browser from inspecting the renderer process). | 1600 // (preventing the browser from inspecting the renderer process). |
1601 int minidump_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( | 1601 int minidump_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( |
1602 GetBreakpadClient()->GetAndroidMinidumpDescriptor()); | 1602 GetBreakpadClient()->GetAndroidMinidumpDescriptor()); |
1603 if (minidump_fd == base::kInvalidPlatformFileValue) { | 1603 if (minidump_fd < 0) { |
1604 NOTREACHED() << "Could not find minidump FD, crash reporting disabled."; | 1604 NOTREACHED() << "Could not find minidump FD, crash reporting disabled."; |
1605 } else { | 1605 } else { |
1606 EnableNonBrowserCrashDumping(process_type, minidump_fd); | 1606 EnableNonBrowserCrashDumping(process_type, minidump_fd); |
1607 } | 1607 } |
1608 } | 1608 } |
1609 } | 1609 } |
1610 #endif // OS_ANDROID | 1610 #endif // OS_ANDROID |
1611 | 1611 |
1612 bool IsCrashReporterEnabled() { | 1612 bool IsCrashReporterEnabled() { |
1613 return g_is_crash_reporter_enabled; | 1613 return g_is_crash_reporter_enabled; |
1614 } | 1614 } |
1615 | 1615 |
1616 } // namespace breakpad | 1616 } // namespace breakpad |
OLD | NEW |