Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/app/breakpad_linux.cc

Issue 11142010: Specify a file size limit for minidumps (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/breakpad_linux.h ('k') | chrome/browser/crash_handler_host_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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 #define SYS_SYSCALL_ENTRYPOINT "playground$syscallEntryPoint" 7 #define SYS_SYSCALL_ENTRYPOINT "playground$syscallEntryPoint"
8 8
9 #include "chrome/app/breakpad_linux.h" 9 #include "chrome/app/breakpad_linux.h"
10 10
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 FilePath dumps_path(tmp_path); 521 FilePath dumps_path(tmp_path);
522 if (PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) { 522 if (PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) {
523 FilePath logfile = 523 FilePath logfile =
524 dumps_path.AppendASCII(CrashUploadList::kReporterLogFilename); 524 dumps_path.AppendASCII(CrashUploadList::kReporterLogFilename);
525 std::string logfile_str = logfile.value(); 525 std::string logfile_str = logfile.value();
526 const size_t crash_log_path_len = logfile_str.size() + 1; 526 const size_t crash_log_path_len = logfile_str.size() + 1;
527 g_crash_log_path = new char[crash_log_path_len]; 527 g_crash_log_path = new char[crash_log_path_len];
528 strncpy(g_crash_log_path, logfile_str.c_str(), crash_log_path_len); 528 strncpy(g_crash_log_path, logfile_str.c_str(), crash_log_path_len);
529 } 529 }
530 DCHECK(!g_breakpad); 530 DCHECK(!g_breakpad);
531 MinidumpDescriptor minidump_descriptor(dumps_path.value());
532 minidump_descriptor.set_size_limit(kMaxMinidumpFileSize);
531 #if defined(OS_ANDROID) 533 #if defined(OS_ANDROID)
532 unattended = true; // Android never uploads directly. 534 unattended = true; // Android never uploads directly.
533 #endif 535 #endif
534 if (unattended) { 536 if (unattended) {
535 g_breakpad = new ExceptionHandler( 537 g_breakpad = new ExceptionHandler(
536 MinidumpDescriptor(dumps_path.value()), 538 minidump_descriptor,
537 NULL, 539 NULL,
538 CrashDoneNoUpload, 540 CrashDoneNoUpload,
539 NULL, 541 NULL,
540 true, // Install handlers. 542 true, // Install handlers.
541 -1); // Server file descriptor. -1 for in-process. 543 -1); // Server file descriptor. -1 for in-process.
542 return; 544 return;
543 } 545 }
544 546
545 #if !defined(OS_ANDROID) 547 #if !defined(OS_ANDROID)
546 // Attended mode 548 // Attended mode
547 g_breakpad = new ExceptionHandler( 549 g_breakpad = new ExceptionHandler(
548 MinidumpDescriptor(dumps_path.value()), 550 minidump_descriptor,
549 NULL, 551 NULL,
550 CrashDoneUpload, 552 CrashDoneUpload,
551 NULL, 553 NULL,
552 true, // Install handlers. 554 true, // Install handlers.
553 -1); // Server file descriptor. -1 for in-process. 555 -1); // Server file descriptor. -1 for in-process.
554 #endif 556 #endif
555 } 557 }
556 558
557 #if defined(OS_ANDROID) 559 #if defined(OS_ANDROID)
558 bool CrashDoneInProcessNoUpload( 560 bool CrashDoneInProcessNoUpload(
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 void InitNonBrowserCrashReporterForAndroid(int minidump_fd) { 1460 void InitNonBrowserCrashReporterForAndroid(int minidump_fd) {
1459 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 1461 const CommandLine* command_line = CommandLine::ForCurrentProcess();
1460 if (command_line->HasSwitch(switches::kEnableCrashReporter)) 1462 if (command_line->HasSwitch(switches::kEnableCrashReporter))
1461 EnableNonBrowserCrashDumping(minidump_fd); 1463 EnableNonBrowserCrashDumping(minidump_fd);
1462 } 1464 }
1463 #endif // OS_ANDROID 1465 #endif // OS_ANDROID
1464 1466
1465 bool IsCrashReporterEnabled() { 1467 bool IsCrashReporterEnabled() {
1466 return g_is_crash_reporter_enabled; 1468 return g_is_crash_reporter_enabled;
1467 } 1469 }
OLDNEW
« no previous file with comments | « chrome/app/breakpad_linux.h ('k') | chrome/browser/crash_handler_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698