diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 19:01:58 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 19:01:58 +0000 |
commit | d119207fd545b3b539390b19cd24f170a6fd769b (patch) | |
tree | 5a3979b1109785b9fc350ce9079458a64a865c55 /chrome/app | |
parent | f75204bedc56872cc0b76626fd53c34dd2d42c75 (diff) | |
download | chromium_src-d119207fd545b3b539390b19cd24f170a6fd769b.zip chromium_src-d119207fd545b3b539390b19cd24f170a6fd769b.tar.gz chromium_src-d119207fd545b3b539390b19cd24f170a6fd769b.tar.bz2 |
Break dependency between breakpad and NaCl on Mac
Instead, go through the breakpad client interface
BUG=247431
R=bauerb@chromium.org
Review URL: https://chromiumcodereview.appspot.com/20513003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/breakpad_mac.mm | 17 | ||||
-rw-r--r-- | chrome/app/chrome_breakpad_client.h | 4 | ||||
-rw-r--r-- | chrome/app/chrome_breakpad_client_mac.mm | 40 |
3 files changed, 45 insertions, 16 deletions
diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index aeebd7f..ae8cc01 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -26,8 +26,6 @@ #include "chrome/common/child_process_logging.h" #include "content/public/common/content_switches.h" #include "components/breakpad/breakpad_client.h" -#include "components/nacl/common/nacl_switches.h" -#include "native_client/src/trusted/service_runtime/osx/crash_filter.h" #include "policy/policy_constants.h" namespace { @@ -98,15 +96,6 @@ bool FatalMessageHandler(int severity, const char* file, int line, return false; } -#if !defined(DISABLE_NACL) -bool NaClBreakpadCrashFilter(int exception_type, - int exception_code, - mach_port_t crashing_thread, - void* context) { - return !NaClMachThreadIsInUntrusted(crashing_thread); -} -#endif - // BreakpadGenerateAndSendReport() does not report the current // thread. This class can be used to spin up a thread to run it. class DumpHelper : public base::PlatformThread::Delegate { @@ -291,11 +280,7 @@ void InitCrashProcessInfo() { process_type = base::SysUTF8ToNSString(process_type_switch); } -#if !defined(DISABLE_NACL) - if (process_type_switch == switches::kNaClLoaderProcess) { - BreakpadSetFilterCallback(gBreakpadRef, NaClBreakpadCrashFilter, NULL); - } -#endif + breakpad::GetBreakpadClient()->InstallAdditionalFilters(gBreakpadRef); // Store process type in crash dump. SetCrashKeyValue(@"ptype", process_type); diff --git a/chrome/app/chrome_breakpad_client.h b/chrome/app/chrome_breakpad_client.h index b11c6f0..8b14f09 100644 --- a/chrome/app/chrome_breakpad_client.h +++ b/chrome/app/chrome_breakpad_client.h @@ -60,6 +60,10 @@ class ChromeBreakpadClient : public breakpad::BreakpadClient { virtual int GetAndroidMinidumpDescriptor() OVERRIDE; #endif +#if defined(OS_MACOSX) + virtual void InstallAdditionalFilters(BreakpadRef breakpad) OVERRIDE; +#endif + private: DISALLOW_COPY_AND_ASSIGN(ChromeBreakpadClient); }; diff --git a/chrome/app/chrome_breakpad_client_mac.mm b/chrome/app/chrome_breakpad_client_mac.mm new file mode 100644 index 0000000..0e842c1 --- /dev/null +++ b/chrome/app/chrome_breakpad_client_mac.mm @@ -0,0 +1,40 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/app/chrome_breakpad_client.h" + +#include "base/command_line.h" +#include "chrome/common/chrome_switches.h" + +#if !defined(DISABLE_NACL) +#import "breakpad/src/client/mac/Framework/Breakpad.h" +#include "components/nacl/common/nacl_switches.h" +#include "native_client/src/trusted/service_runtime/osx/crash_filter.h" +#endif + +namespace chrome { + +namespace { + +#if !defined(DISABLE_NACL) +bool NaClBreakpadCrashFilter(int exception_type, + int exception_code, + mach_port_t crashing_thread, + void* context) { + return !NaClMachThreadIsInUntrusted(crashing_thread); +} +#endif + +} // namespace + +void ChromeBreakpadClient::InstallAdditionalFilters(BreakpadRef breakpad) { +#if !defined(DISABLE_NACL) + if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kProcessType) == switches::kNaClLoaderProcess) { + BreakpadSetFilterCallback(breakpad, NaClBreakpadCrashFilter, NULL); + } +#endif +} + +} // namespace chrome |