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

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

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 722
723 if (HANDLE_EINTR(sys_read(fds[0], &b, 1)) != 1) { 723 if (HANDLE_EINTR(sys_read(fds[0], &b, 1)) != 1) {
724 static const char msg[] = "Parent failed to complete crash dump.\n"; 724 static const char msg[] = "Parent failed to complete crash dump.\n";
725 sys_write(2, msg, sizeof(msg)-1); 725 sys_write(2, msg, sizeof(msg)-1);
726 } 726 }
727 727
728 return true; 728 return true;
729 } 729 }
730 730
731 void EnableNonBrowserCrashDumping() { 731 void EnableNonBrowserCrashDumping() {
732 const int fd = Singleton<base::GlobalDescriptors>()->Get(kCrashDumpSignal); 732 const int fd = base::GlobalDescriptors::GetInstance()->Get(kCrashDumpSignal);
733 is_crash_reporter_enabled = true; 733 is_crash_reporter_enabled = true;
734 // We deliberately leak this object. 734 // We deliberately leak this object.
735 google_breakpad::ExceptionHandler* handler = 735 google_breakpad::ExceptionHandler* handler =
736 new google_breakpad::ExceptionHandler("" /* unused */, NULL, NULL, 736 new google_breakpad::ExceptionHandler("" /* unused */, NULL, NULL,
737 (void*) fd, true); 737 (void*) fd, true);
738 handler->set_crash_handler(NonBrowserCrashHandler); 738 handler->set_crash_handler(NonBrowserCrashHandler);
739 } 739 }
740 740
741 void InitCrashReporter() { 741 void InitCrashReporter() {
742 // Determine the process type and take appropriate action. 742 // Determine the process type and take appropriate action.
(...skipping 29 matching lines...) Expand all
772 struct timeval tv; 772 struct timeval tv;
773 if (!gettimeofday(&tv, NULL)) 773 if (!gettimeofday(&tv, NULL))
774 process_start_time = timeval_to_ms(&tv); 774 process_start_time = timeval_to_ms(&tv);
775 else 775 else
776 process_start_time = 0; 776 process_start_time = 0;
777 } 777 }
778 778
779 bool IsCrashReporterEnabled() { 779 bool IsCrashReporterEnabled() {
780 return is_crash_reporter_enabled; 780 return is_crash_reporter_enabled;
781 } 781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698