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 3 // found in the LICENSE file. 4 5 #include "chrome/app/chrome_breakpad_client.h" 6 7 #include "base/command_line.h" 8 #include "chrome/common/chrome_switches.h" 9 10 #if !defined(DISABLE_NACL) 11 #import "breakpad/src/client/mac/Framework/Breakpad.h" 12 #include "components/nacl/common/nacl_switches.h" 13 #include "native_client/src/trusted/service_runtime/osx/crash_filter.h" 14 #endif 15 16 namespace chrome { 17 18 namespace { 19 20 #if !defined(DISABLE_NACL) 21 bool NaClBreakpadCrashFilter(int exception_type, 22 int exception_code, 23 mach_port_t crashing_thread, 24 void* context) { 25 return !NaClMachThreadIsInUntrusted(crashing_thread); 26 } 27 #endif 28 29 } // namespace 30 31 void ChromeBreakpadClient::InstallAdditionalFilters(BreakpadRef breakpad) { 32 #if !defined(DISABLE_NACL) 33 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 34 switches::kProcessType) == switches::kNaClLoaderProcess) { 35 BreakpadSetFilterCallback(breakpad, NaClBreakpadCrashFilter, NULL); 36 } 37 #endif 38 } 39 40 } // namespace chrome 41