diff --git a/client/crashpad_client.h b/client/crashpad_client.h index 8576427b..594f3075 100644 --- a/client/crashpad_client.h +++ b/client/crashpad_client.h @@ -467,6 +467,22 @@ class CrashpadClient { const std::string& url, const std::map& annotations); + //! \brief Requests that the handler convert intermediate dumps into + //! minidumps and trigger an upload if possible. + //! + //! A handler must have already been installed before calling this method. + //! This method should be called when an application is ready to start + //! processing previously created intermediate dumps and begin uploading. + //! Processing will block, so this should not be called on the main UI thread. + //! No intermediate dumps will be processed (and therefore no minidumps will + //! uploaded) until this method (or DumpWithoutCrash) is called. + //! + //! \param[in] annotations Process annotations to set in each crash report. + //! Useful when adding crash annotations detected on the next run after a + //! crash but before upload. + void ProcessIntermediateDumps( + const std::map& annotations = {}); + // TODO(justincohen): This method is purely for bringing up iOS interfaces. //! \brief Requests that the handler capture a dump even though there hasn't //! been a crash. diff --git a/client/crashpad_client_ios.cc b/client/crashpad_client_ios.cc index 673475c3..a40786b3 100644 --- a/client/crashpad_client_ios.cc +++ b/client/crashpad_client_ios.cc @@ -53,6 +53,9 @@ class CrashHandler : public Thread, public UniversalMachExcServer::Interface { INITIALIZATION_STATE_SET_VALID(initialized_); } + void ProcessIntermediateDumps( + const std::map& annotations = {}) {} + void DumpWithoutCrash(NativeCPUContext* context) { INITIALIZATION_STATE_DCHECK_VALID(initialized_); mach_exception_data_type_t code[2] = {}; @@ -210,6 +213,7 @@ CrashpadClient::CrashpadClient() {} CrashpadClient::~CrashpadClient() {} +// static void CrashpadClient::StartCrashpadInProcessHandler( const base::FilePath& database, const std::string& url, @@ -221,11 +225,20 @@ void CrashpadClient::StartCrashpadInProcessHandler( crash_handler->Initialize(); } +// static +void CrashpadClient::ProcessIntermediateDumps( + const std::map& annotations) { + CrashHandler* crash_handler = CrashHandler::Get(); + DCHECK(crash_handler); + crash_handler->ProcessIntermediateDumps(annotations); +} + // static void CrashpadClient::DumpWithoutCrash(NativeCPUContext* context) { CrashHandler* crash_handler = CrashHandler::Get(); DCHECK(crash_handler); crash_handler->DumpWithoutCrash(context); + crash_handler->ProcessIntermediateDumps(); } } // namespace crashpad