Index: chrome/browser/mac/exception_processor.h |
diff --git a/chrome/browser/mac/exception_processor.h b/chrome/browser/mac/exception_processor.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9ff2c66c5f04e104349743b218ab9b259c227a4d |
--- /dev/null |
+++ b/chrome/browser/mac/exception_processor.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 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. |
+ |
+#ifndef CHROME_BROWSER_MAC_EXCEPTION_PROCESSOR_H_ |
+#define CHROME_BROWSER_MAC_EXCEPTION_PROCESSOR_H_ |
+ |
+#include <stddef.h> |
+ |
+@class NSException; |
+ |
+namespace chrome { |
+ |
+// Installs the Objective-C exception preprocessor. This records UMA and crash |
+// keys for NSException objects. The preprocessor will also make fatal any |
+// exception that is not handled. |
+void InstallObjcExceptionPreprocessor(); |
+ |
+// The items below are exposed only for testing. |
+//////////////////////////////////////////////////////////////////////////////// |
+ |
+// Removes the exception preprocessor if it is installed. |
+void UninstallObjcExceptionPreprocessor(); |
+ |
+ |
Mark Mentovai
2016/12/01 19:02:32
Extra blank line?
Robert Sesek
2016/12/06 23:18:09
Done.
|
+// Bin for unknown exceptions. Exposed for testing purposes. |
Mark Mentovai
2016/12/01 19:02:32
“Exposed for testing purposes” on all of these isn
Robert Sesek
2016/12/06 23:18:09
Done.
|
+extern const size_t kUnknownNSException; |
Mark Mentovai
2016/12/01 19:02:32
Can be constexpr and get its value right here?
Robert Sesek
2016/12/06 23:18:09
Its value is kKnownNSExceptionCount, which isn't p
|
+ |
+// Returns the histogram bin for |exception| if it is one we track |
+// specifically, or |kUnknownNSException| if unknown. Exposed for testing |
+// purposes. |
+size_t BinForException(NSException* exception); |
+ |
+// Use UMA to track exception occurance. Exposed for testing purposes. |
+void RecordExceptionWithUma(NSException* exception); |
+ |
+} // namespace chrome |
+ |
+#endif // CHROME_BROWSER_MAC_EXCEPTION_PROCESSOR_H_ |