Index: handler/win/crash_report_exception_handler.h |
diff --git a/handler/mac/crash_report_exception_handler.h b/handler/win/crash_report_exception_handler.h |
similarity index 62% |
copy from handler/mac/crash_report_exception_handler.h |
copy to handler/win/crash_report_exception_handler.h |
index a09c6b8620e867778ab9fb84174d93a1245eaa78..60e6b6ad8ccc2466e16dea0ddcc76fa4780c5e3a 100644 |
--- a/handler/mac/crash_report_exception_handler.h |
+++ b/handler/win/crash_report_exception_handler.h |
@@ -12,24 +12,24 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#ifndef CRASHPAD_HANDLER_MAC_CRASH_REPORT_EXCEPTION_HANDLER_H_ |
-#define CRASHPAD_HANDLER_MAC_CRASH_REPORT_EXCEPTION_HANDLER_H_ |
+#ifndef CRASHPAD_HANDLER_WIN_CRASH_REPORT_EXCEPTION_HANDLER_H_ |
+#define CRASHPAD_HANDLER_WIN_CRASH_REPORT_EXCEPTION_HANDLER_H_ |
-#include <mach/mach.h> |
+#include <windows.h> |
#include <map> |
#include <string> |
-#include "base/basictypes.h" |
-#include "client/crash_report_database.h" |
-#include "handler/crash_report_upload_thread.h" |
-#include "util/mach/exc_server_variants.h" |
+#include "util/win/exception_handler_server.h" |
namespace crashpad { |
+class CrashReportDatabase; |
+class CrashReportUploadThread; |
+ |
//! \brief An exception handler that writes crash reports for exception messages |
//! to a CrashReportDatabase. |
-class CrashReportExceptionHandler : public UniversalMachExcServer::Interface { |
+class CrashReportExceptionHandler : public ExceptionHandlerServer::Delegate { |
public: |
//! \brief Creates a new object that will store crash reports in \a database. |
//! |
@@ -39,10 +39,10 @@ class CrashReportExceptionHandler : public UniversalMachExcServer::Interface { |
//! \param[in] process_annotations A map of annotations to insert as |
//! process-level annotations into each crash report that is written. Do |
//! not confuse this with module-level annotations, which are under the |
- //! control of the crashing process, and are used to implement Chrome’s |
- //! “crash keys.” Process-level annotations are those that are beyond the |
+ //! control of the crashing process, and are used to implement Chrome's |
+ //! "crash keys." Process-level annotations are those that are beyond the |
//! control of the crashing process, which must reliably be set even if |
- //! the process crashes before it’s able to establish its own annotations. |
+ //! the process crashes before it's able to establish its own annotations. |
//! To interoperate with Breakpad servers, the recommended practice is to |
//! specify values for the `"prod"` and `"ver"` keys as process |
//! annotations. |
@@ -51,27 +51,16 @@ class CrashReportExceptionHandler : public UniversalMachExcServer::Interface { |
CrashReportUploadThread* upload_thread, |
const std::map<std::string, std::string>* process_annotations); |
- ~CrashReportExceptionHandler(); |
+ ~CrashReportExceptionHandler() override; |
- // UniversalMachExcServer::Interface: |
+ // ExceptionHandlerServer::Delegate: |
//! \brief Processes an exception message by writing a crash report to this |
- //! object’s CrashReportDatabase. |
- kern_return_t CatchMachException( |
- exception_behavior_t behavior, |
- exception_handler_t exception_port, |
- thread_t thread, |
- task_t task, |
- exception_type_t exception, |
- const mach_exception_data_type_t* code, |
- mach_msg_type_number_t code_count, |
- thread_state_flavor_t* flavor, |
- ConstThreadState old_state, |
- mach_msg_type_number_t old_state_count, |
- thread_state_t new_state, |
- mach_msg_type_number_t* new_state_count, |
- const mach_msg_trailer_t* trailer, |
- bool* destroy_complex_request) override; |
+ //! object's CrashReportDatabase. |
+ void ExceptionHandlerServerStarted() override; |
+ unsigned int ExceptionHandlerServerException( |
+ HANDLE process, |
+ WinVMAddress exception_information_address) override; |
private: |
CrashReportDatabase* database_; // weak |
@@ -83,4 +72,4 @@ class CrashReportExceptionHandler : public UniversalMachExcServer::Interface { |
} // namespace crashpad |
-#endif // CRASHPAD_HANDLER_MAC_CRASH_REPORT_EXCEPTION_HANDLER_H_ |
+#endif // CRASHPAD_HANDLER_WIN_CRASH_REPORT_EXCEPTION_HANDLER_H_ |