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

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

Issue 6193005: Enable Breakpad for crashes in trusted code in Native Client on Chrome for Li... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months 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 | « no previous file | chrome/browser/nacl_host/nacl_process_host.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) 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); 639 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
640 new google_breakpad::ExceptionHandler(dumps_path.value().c_str(), NULL, 640 new google_breakpad::ExceptionHandler(dumps_path.value().c_str(), NULL,
641 CrashDoneNoUpload, NULL, 641 CrashDoneNoUpload, NULL,
642 true /* install handlers */); 642 true /* install handlers */);
643 } else { 643 } else {
644 new google_breakpad::ExceptionHandler("/tmp", NULL, CrashDoneUpload, NULL, 644 new google_breakpad::ExceptionHandler("/tmp", NULL, CrashDoneUpload, NULL,
645 true /* install handlers */); 645 true /* install handlers */);
646 } 646 }
647 } 647 }
648 648
649 // Currently Non-Browser = Renderer and Plugins 649 // Currently Non-Browser = Renderer, Plugins and Native Client
650 static bool 650 static bool
651 NonBrowserCrashHandler(const void* crash_context, size_t crash_context_size, 651 NonBrowserCrashHandler(const void* crash_context, size_t crash_context_size,
652 void* context) { 652 void* context) {
653 const int fd = reinterpret_cast<intptr_t>(context); 653 const int fd = reinterpret_cast<intptr_t>(context);
654 int fds[2] = { -1, -1 }; 654 int fds[2] = { -1, -1 };
655 if (sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { 655 if (sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
656 static const char msg[] = "Failed to create socket for crash dumping.\n"; 656 static const char msg[] = "Failed to create socket for crash dumping.\n";
657 sys_write(2, msg, sizeof(msg)-1); 657 sys_write(2, msg, sizeof(msg)-1);
658 return false; 658 return false;
659 } 659 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
743 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 743 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
744 const std::string process_type = 744 const std::string process_type =
745 parsed_command_line.GetSwitchValueASCII(switches::kProcessType); 745 parsed_command_line.GetSwitchValueASCII(switches::kProcessType);
746 if (process_type.empty()) { 746 if (process_type.empty()) {
747 EnableCrashDumping(getenv(env_vars::kHeadless) != NULL); 747 EnableCrashDumping(getenv(env_vars::kHeadless) != NULL);
748 } else if (process_type == switches::kRendererProcess || 748 } else if (process_type == switches::kRendererProcess ||
749 process_type == switches::kPluginProcess || 749 process_type == switches::kPluginProcess ||
750 process_type == switches::kZygoteProcess) { 750 process_type == switches::kZygoteProcess ||
751 process_type == switches::kNaClLoaderProcess) {
751 // We might be chrooted in a zygote or renderer process so we cannot call 752 // We might be chrooted in a zygote or renderer process so we cannot call
752 // GetCollectStatsConsent because that needs access the the user's home 753 // GetCollectStatsConsent because that needs access the the user's home
753 // dir. Instead, we set a command line flag for these processes. 754 // dir. Instead, we set a command line flag for these processes.
754 // Even though plugins are not chrooted, we share the same code path for 755 // Even though plugins are not chrooted, we share the same code path for
755 // simplicity. 756 // simplicity.
756 if (!parsed_command_line.HasSwitch(switches::kEnableCrashReporter)) 757 if (!parsed_command_line.HasSwitch(switches::kEnableCrashReporter))
757 return; 758 return;
758 // Get the guid and linux distro from the command line switch. 759 // Get the guid and linux distro from the command line switch.
759 std::string switch_value = 760 std::string switch_value =
760 parsed_command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); 761 parsed_command_line.GetSwitchValueASCII(switches::kEnableCrashReporter);
(...skipping 11 matching lines...) Expand all
772 struct timeval tv; 773 struct timeval tv;
773 if (!gettimeofday(&tv, NULL)) 774 if (!gettimeofday(&tv, NULL))
774 process_start_time = timeval_to_ms(&tv); 775 process_start_time = timeval_to_ms(&tv);
775 else 776 else
776 process_start_time = 0; 777 process_start_time = 0;
777 } 778 }
778 779
779 bool IsCrashReporterEnabled() { 780 bool IsCrashReporterEnabled() {
780 return is_crash_reporter_enabled; 781 return is_crash_reporter_enabled;
781 } 782 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698