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

Unified Diff: chrome/browser/mac/exception_processor.h

Issue 2543813003: [Mac] Modify the ObjC exception preprocessor to make some exceptions fatal. (Closed)
Patch Set: Address comments Created 4 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 side-by-side diff with in-line comments
Download patch
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..3a9f3915740189c6961f79bf97c94db0f7d4821e
--- /dev/null
+++ b/chrome/browser/mac/exception_processor.h
@@ -0,0 +1,37 @@
+// 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();
+
+// Bin for unknown exceptions.
+extern const size_t kUnknownNSException;
+
+// Returns the histogram bin for |exception| if it is one we track
+// specifically, or |kUnknownNSException| if unknown.
+size_t BinForException(NSException* exception);
+
+// Use UMA to track exception occurance.
+void RecordExceptionWithUma(NSException* exception);
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_MAC_EXCEPTION_PROCESSOR_H_
« no previous file with comments | « chrome/browser/chrome_browser_application_mac_unittest.mm ('k') | chrome/browser/mac/exception_processor.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698